MongolidLaravel\MongolidModelTest::testShouldGetWhere PHP Méthode

testShouldGetWhere() public méthode

public testShouldGetWhere ( )
    public function testShouldGetWhere()
    {
        // Set
        $dataMapper = m::mock(DataMapper::class);
        $this->app->instance(DataMapper::class, $dataMapper);
        $cursor = m::mock(Cursor::class);
        $model = new class extends MongolidModel
        {
            protected $collection = 'collection_name';
        };
        // Expectations
        $dataMapper->shouldReceive('where')->once()->withAnyArgs()->andReturn($cursor);
        // Actions
        $result = $model->where(['field' => '123']);
        // Assertions
        $this->assertEquals($cursor, $result);
    }