lithium\tests\cases\data\ModelTest::testMagicFinders PHP Метод

testMagicFinders() публичный Метод

public testMagicFinders ( )
    public function testMagicFinders()
    {
        $result = MockPost::findById(5);
        $result2 = MockPost::findFirstById(5);
        $this->assertEqual($result2, $result);
        $expected = array('id' => 5);
        $this->assertEqual($expected, $result['query']->conditions());
        $this->assertEqual('read', $result['query']->type());
        $result = MockPost::findAllByFoo(13, array('order' => array('created_at' => 'desc')));
        $this->assertEmpty($result['query']->data());
        $this->assertEqual(array('foo' => 13), $result['query']->conditions());
        $this->assertEqual(array('created_at' => 'desc'), $result['query']->order());
        $this->assertException('/Method `findFoo` not defined or handled in class/', function () {
            MockPost::findFoo();
        });
    }
ModelTest