Open Monograph Press  3.3.0
MapFactoryTest.php
1 <?php
2 
4 
6 
11 {
12  public function mapProvider()
13  {
14  return array(
15  array('foo', null),
16  array('test', 'Guzzle\Tests\Service\Mock\Command\MockCommand'),
17  array('test1', 'Guzzle\Tests\Service\Mock\Command\OtherCommand')
18  );
19  }
20 
24  public function testCreatesCommandsUsingMappings($key, $result)
25  {
26  $factory = new MapFactory(array(
27  'test' => 'Guzzle\Tests\Service\Mock\Command\MockCommand',
28  'test1' => 'Guzzle\Tests\Service\Mock\Command\OtherCommand'
29  ));
30 
31  if (is_null($result)) {
32  $this->assertNull($factory->factory($key));
33  } else {
34  $this->assertInstanceof($result, $factory->factory($key));
35  }
36  }
37 }
Guzzle\Tests\GuzzleTestCase
Definition: GuzzleTestCase.php:22
Guzzle\Service\Command\Factory\MapFactory
Definition: MapFactory.php:8
Guzzle\Tests\Service\Command\MapFactoryTest\mapProvider
mapProvider()
Definition: MapFactoryTest.php:12
Guzzle\Tests\Service\Command\MapFactoryTest
Definition: MapFactoryTest.php:10
Guzzle\Tests\Service\Command
Definition: AbstractCommandTest.php:3
Guzzle\Tests\Service\Command\MapFactoryTest\testCreatesCommandsUsingMappings
testCreatesCommandsUsingMappings($key, $result)
Definition: MapFactoryTest.php:24