Mongolid\ManagerTest::testShouldGetDataMapperForEntitiesWithRegisteredSchemas PHP Method

testShouldGetDataMapperForEntitiesWithRegisteredSchemas() public method

    public function testShouldGetDataMapperForEntitiesWithRegisteredSchemas()
    {
        // Arrange
        $manager = new Manager();
        $schema = m::mock(Schema::class);
        $dataMapper = m::mock(DataMapper::class)->makePartial();
        $schema->entityClass = 'Bacon';
        // Act
        Ioc::instance(DataMapper::class, $dataMapper);
        // Assert
        $manager->registerSchema($schema);
        $result = $manager->getMapper('Bacon');
        $this->assertEquals($dataMapper, $result);
        $this->assertAttributeEquals($schema, 'schema', $result);
    }