* @license MIT * * @group Coverage */ class ParameterHasherTest extends PHPUnit_Framework_TestCase { /** * @dataProvider getParameters * * @covers \ProxyManager\Inflector\Util\ParameterHasher::hashParameters */ public function testGeneratesValidClassName(array $parameters, $expectedHash) { $encoder = new ParameterHasher(); $this->assertSame($expectedHash, $encoder->hashParameters($parameters)); } /** * @return array */ public function getParameters() { return array( array(array(), '40cd750bba9870f18aada2478b24840a'), array(array('foo' => 'bar'), '49a3696adf0fbfacc12383a2d7400d51'), array(array('bar' => 'baz'), '6ed41c8a63c1571554ecaeb998198757'), array(array(null), '38017a839aaeb8ff1a658fce9af6edd3'), array(array(null, null), '12051f9a58288e5328ad748881cc4e00'), array(array('bar' => null), '0dbb112e1c4e6e4126232de2daa2d660'), array(array('bar' => 12345), 'eb6291ea4973741bf9b6571f49b4ffd2'), array(array('foo' => 'bar', 'bar' => 'baz'), '4447ff857f244d24c31bd84d7a855eda'), ); } }