Phalcon\Test\Unit\Mvc\Collection\ClassChangeCest::change PHP Метод

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

public change ( UnitTester $I )
$I UnitTester
    public function change(UnitTester $I)
    {
        $I->wantTo("fetch result from collection in desired class");
        $this->setupMongo($I);
        $book = new Books();
        $book->title = 'book';
        $I->assertTrue($book->save());
        $book = Books::findFirst([['_id' => $book->getId()]]);
        $I->assertInstanceOf('\\Phalcon\\Test\\Collections\\Bookshelf\\Books', $book);
        $magazine = Books::findFirst([['_id' => $book->getId()], 'class' => '\\Phalcon\\Test\\Collections\\Bookshelf\\Magazines']);
        $I->assertInstanceOf('\\Phalcon\\Test\\Collections\\Bookshelf\\Magazines', $magazine);
        $document = Books::findFirst([['_id' => $book->getId()], 'class' => '\\Phalcon\\Mvc\\Collection\\Document']);
        $I->assertInstanceOf('\\Phalcon\\Mvc\\Collection\\Document', $document);
        $I->assertTrue($book->delete());
    }