コード例 #1
0
ファイル: TestCase.php プロジェクト: leloulight/trigglog
 protected function fillWithData()
 {
     $foos = ['First Foo', 'Second Foo', 'Third Foo'];
     foreach ($foos as $foo) {
         Foo::create(['title' => $foo]);
     }
     $bazs = ['First Baz', 'Second Baz', 'Third Baz'];
     foreach ($bazs as $baz) {
         Baz::create(['title' => $baz]);
     }
     $bars = [['foo_id' => 1, 'baz_id' => 1, 'title' => 'First Foo First Baz Bar'], ['foo_id' => 1, 'baz_id' => 2, 'title' => 'First Foo Second Baz Bar']];
     foreach ($bars as $bar) {
         Bar::create($bar);
     }
     $boms = [['bar_id' => 1, 'title' => 'First Bar Bom'], ['bar_id' => 2, 'title' => 'Second Bar Bom']];
     foreach ($boms as $bom) {
         Bom::create($bom);
     }
 }
コード例 #2
0
ファイル: ModelTest.php プロジェクト: smetana/tipy
 public function testCustomTableName()
 {
     $foo = Foo::create(['value' => 'Test']);
     $foo = Foo::findFirst(['conditions' => "value='Test'"]);
     $this->assertNotNull($foo);
 }
コード例 #3
0
 public function testCalledClass()
 {
     $foo = Foo::create();
     $this->assertEquals('SingletonTest', $foo->called_by());
 }
コード例 #4
0
 public function testRuleAppliesToStaticMethodAccess()
 {
     Foo::create();
 }