Phalcon\Test\Unit\Mvc\ModelTest::testFindersNormal PHP Method

testFindersNormal() public method

public testFindersNormal ( )
    public function testFindersNormal()
    {
        $this->specify("Models can't be found properly", function () {
            $robot = Robots::findFirstById(1);
            expect($robot)->isInstanceOf(Robots::class);
            expect($robot->id)->equals(1);
            $robot = Robots::findFirstById(2);
            expect($robot)->isInstanceOf(Robots::class);
            expect($robot->id)->equals(2);
            $robots = Robots::findByType('mechanical');
            expect($robots)->count(2);
            expect($robots[0]->id)->equals(1);
            expect(Robots::countByType('mechanical'))->equals(2);
        });
    }