14 $mock = $this->getMock(
'Guzzle\Inflection\Inflector', array(
'snake',
'camel'));
15 $mock->expects($this->once())->method(
'snake')->with(
'Test')->will($this->returnValue(
'test'));
16 $mock->expects($this->once())->method(
'camel')->with(
'Test')->will($this->returnValue(
'Test'));
17 $inflector =
new PreComputedInflector($mock, array(
'FooBar' =>
'foo_bar'), array(
'foo_bar' =>
'FooBar'));
18 $this->assertEquals(
'FooBar', $inflector->camel(
'foo_bar'));
19 $this->assertEquals(
'foo_bar', $inflector->snake(
'FooBar'));
20 $this->assertEquals(
'Test', $inflector->camel(
'Test'));
21 $this->assertEquals(
'test', $inflector->snake(
'Test'));
26 $mock = $this->getMock(
'Guzzle\Inflection\Inflector', array(
'snake',
'camel'));
27 $mock->expects($this->never())->method(
'snake');
28 $mock->expects($this->never())->method(
'camel');
30 $this->assertEquals(
'Zeep', $inflector->camel(
'zeep'));
31 $this->assertEquals(
'zeep', $inflector->snake(
'Zeep'));
36 $mock = $this->getMock(
'Guzzle\Inflection\Inflector', array(
'snake',
'camel'));
37 $mock->expects($this->never())->method(
'snake');
38 $mock->expects($this->never())->method(
'camel');
39 $inflector =
new PreComputedInflector($mock, array(
'Zeep' =>
'zeep'), array(
'foo' =>
'Foo'),
true);
40 $this->assertEquals(
'Zeep', $inflector->camel(
'zeep'));
41 $this->assertEquals(
'zeep', $inflector->snake(
'Zeep'));
42 $this->assertEquals(
'Foo', $inflector->camel(
'foo'));
43 $this->assertEquals(
'foo', $inflector->snake(
'Foo'));