* @license MIT * * @group Coverage */ class ParameterEncoderTest extends PHPUnit_Framework_TestCase { /** * @dataProvider getParameters * * @covers \ProxyManager\Inflector\Util\ParameterEncoder::encodeParameters */ public function testGeneratesValidClassName(array $parameters) { $encoder = new ParameterEncoder(); $this->assertRegExp( '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]+/', $encoder->encodeParameters($parameters), 'Encoded string is a valid class identifier' ); } /** * @return array */ public function getParameters() { return array( array(array()), array(array('foo' => 'bar')), array(array('bar' => 'baz')), array(array(null)), array(array(null, null)), array(array('bar' => null)), array(array('bar' => 12345)), array(array('foo' => 'bar', 'bar' => 'baz')), ); } }