Inheritance: extends Pheasant\DomainObject
Beispiel #1
0
 public function testSaveInAfterCreateDoesntLoop()
 {
     $this->mapper->shouldReceive('save')->times(2);
     $this->initialize('Pheasant\\Tests\\Examples\\EventTestObject', function ($builder) {
         $builder->properties(array('test' => new Types\StringType()));
         $builder->events(array('afterCreate' => function ($event, $obj) {
             $obj->save();
         }));
     });
     $do = new EventTestObject();
     $do->test = "blargh";
     $do->save();
 }