Mongolid\ActiveRecordTest::testShouldGetDataMapper PHP Method

testShouldGetDataMapper() public method

    public function testShouldGetDataMapper()
    {
        // Arrage
        $entity = m::mock(ActiveRecord::class . '[getSchema]');
        $schema = m::mock(Schema::class . '[]');
        // Act
        $entity->shouldAllowMockingProtectedMethods();
        $entity->shouldReceive('getSchema')->once()->andReturn($schema);
        // Assert
        $result = $this->callProtected($entity, 'getDataMapper');
        $this->assertInstanceOf(DataMapper\DataMapper::class, $result);
        $this->assertEquals($schema, $result->getSchema());
    }