Fhaculty\Graph\Tests\Attribute\AtributeBagNamespacedTest::testReadableEntities PHP Method

testReadableEntities() public method

public testReadableEntities ( Fhaculty\Graph\Attribute\AttributeAware $entity )
$entity Fhaculty\Graph\Attribute\AttributeAware
    public function testReadableEntities(AttributeAware $entity)
    {
        $bag = new AttributeBagNamespaced($entity, 'test.');
        $this->assertSame($bag, $bag->getAttributeBag());
        $entity->setAttribute('a.b', 'c');
        $entity->setAttribute('test.d', 'e');
        $this->assertEquals('e', $bag->getAttribute('d'));
        $this->assertNull($bag->getAttribute('a.b'));
        $this->assertNull($bag->getAttribute('test.d'));
        $this->assertEquals(array('d' => 'e'), $bag->getAttributes());
    }