/** * @covers \ProxyManager\Inflector\ClassNameInflector::getProxyClassName * * @dataProvider getClassAndParametersCombinations * * @param string $className * @param array $parameters */ public function testClassNameIsValidClassIdentifier($className, array $parameters) { $inflector = new ClassNameInflector('ProxyNS'); $this->assertRegExp('/([a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]+)(\\\\[a-zA-Z_\\x7f-\\xff][a-zA-Z0-9_\\x7f-\\xff]+)*/', $inflector->getProxyClassName($className, $parameters), 'Class name string is a valid class identifier'); }
/** * @covers \ProxyManager\Inflector\ClassNameInflector::getProxyClassName */ public function testGeneratesCorrectClassNameWhenGivenLeadingBackslash() { $inflector = new ClassNameInflector('ProxyNS'); $this->assertSame($inflector->getProxyClassName('\\Foo\\Bar', array('tab' => 'baz')), $inflector->getProxyClassName('Foo\\Bar', array('tab' => 'baz'))); }