Mongolid\DataMapper\SchemaMapperTest::testShouldGetAttributesWhenGetAttributesMethodIsAvailable PHP Метод

testShouldGetAttributesWhenGetAttributesMethodIsAvailable() публичный Метод

    public function testShouldGetAttributesWhenGetAttributesMethodIsAvailable()
    {
        // Arrange
        $schema = m::mock(Schema::class);
        $schemaMapper = new SchemaMapper($schema);
        $object = new class
        {
            public function getAttributes()
            {
                return ['foo' => 'bar'];
            }
        };
        // Assert
        $this->assertEquals(['foo' => 'bar'], $this->callProtected($schemaMapper, 'parseToArray', [$object]));
    }