public function testConcat() { $this->assertEquals(new Name('foo\\bar\\baz'), Name::concat('foo', 'bar\\baz')); $this->assertEquals(new Name\FullyQualified('foo\\bar'), Name\FullyQualified::concat(['foo'], new Name('bar'))); $attributes = ['foo' => 'bar']; $this->assertEquals(new Name\Relative('foo\\bar\\baz', $attributes), Name\Relative::concat(new Name\FullyQualified('foo\\bar'), 'baz', $attributes)); $this->assertEquals(new Name('foo'), Name::concat([], 'foo')); $this->assertEquals(new Name([]), Name::concat([], [])); }
/** * @expectedException \InvalidArgumentException * @expectedExceptionMessage Expected string, array of parts or Name instance */ public function testInvalidArg() { Name::concat('foo', new \stdClass()); }