コード例 #1
0
ファイル: DomainObjectTest.php プロジェクト: lox/pheasant
 public function testObjectTransactionNotExecuting()
 {
     $this->assertCount(0, Animal::findByType('llama'));
     $t = \Pheasant::transaction(function () {
         $animal = new Animal(array('type' => 'llama'));
         $animal->save();
     }, false);
     $this->assertCount(0, Animal::findByType('llama'));
     $t->execute();
     $this->assertCount(1, Animal::findByType('llama'));
 }
コード例 #2
0
ファイル: CollectionTest.php プロジェクト: lox/pheasant
 public function testDelete()
 {
     Animal::findByType('frog')->delete();
     $this->assertCount(1, Animal::all());
 }