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

testEmptyConditions() public method

Tests find with empty conditions + bind and limit.
Since: 2016-07-29
Author: Serghei Iakovlev ([email protected])
public testEmptyConditions ( )
    public function testEmptyConditions()
    {
        if (!ini_get('opcache.enable_cli')) {
            $this->markTestSkipped('Warning: opcache.enable_cli must be set to "On"');
        }
        $this->specify('The Model::find with empty conditions + bind and limit return wrong result', function () {
            $album = Albums::find(['conditions' => '', 'bind' => [], 'limit' => 10]);
            expect($album)->isInstanceOf(Simple::class);
            expect($album->getFirst())->isInstanceOf(Albums::class);
            expect($album->getFirst()->toArray())->equals(['id' => 1, 'artists_id' => 1, 'name' => 'Born to Die']);
        });
    }