Mongolid\DataMapper\SchemaMapperTest::testShouldParseFieldIntoAnotherMappedSchemaIfTypeBeginsWithSchema PHP Method

testShouldParseFieldIntoAnotherMappedSchemaIfTypeBeginsWithSchema() public method

    public function testShouldParseFieldIntoAnotherMappedSchemaIfTypeBeginsWithSchema()
    {
        // Arrange
        $schema = m::mock(Schema::class);
        $schemaMapper = m::mock(SchemaMapper::class . '[mapToSchema]', [$schema]);
        $schemaMapper->shouldAllowMockingProtectedMethods();
        // Act
        $schemaMapper->shouldReceive('mapToSchema')->once()->with(['foo' => 'bar'], 'FooBarSchema')->andReturn(['foo' => 123]);
        // Assert
        $this->assertSame(['foo' => 123], $schemaMapper->parseField(['foo' => 'bar'], 'schema.FooBarSchema'));
    }