Fhaculty\Graph\Tests\Attribute\AttributeBagContainerTest::testSome PHP Method

testSome() public method

public testSome ( )
    public function testSome()
    {
        $bag = new AttributeBagContainer();
        $bag->setAttribute('true', true);
        $bag->setAttribute('two', 2);
        $this->assertSame(true, $bag->getAttribute('true'));
        $this->assertSame(2, $bag->getAttribute('two'));
        $this->assertEquals(array('true' => true, 'two' => 2), $bag->getAttributes());
        $bag->setAttribute('float', '1.2');
        $bag->setAttributes(array('two' => 'two', 'three' => 3));
        $expected = array('true' => true, 'two' => 'two', 'float' => 1.2, 'three' => 3);
        $this->assertEquals($expected, $bag->getAttributes());
    }