diff options
author | Andreas Baumann <mail@andreasbaumann.cc> | 2019-11-17 20:45:02 +0100 |
---|---|---|
committer | Andreas Baumann <mail@andreasbaumann.cc> | 2019-11-17 20:45:02 +0100 |
commit | 8df3db566a3a937b45ebf11adb90d265e6f5e2d4 (patch) | |
tree | 4d541098d751d5a9acf8c12f6fb9f308ace066ac /vendor/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ConcreteClassFactoryTest.php | |
download | flyspray-8df3db566a3a937b45ebf11adb90d265e6f5e2d4.tar.xz |
initial checking of customized version 1.0rc9
Diffstat (limited to 'vendor/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ConcreteClassFactoryTest.php')
-rw-r--r-- | vendor/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ConcreteClassFactoryTest.php | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/vendor/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ConcreteClassFactoryTest.php b/vendor/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ConcreteClassFactoryTest.php new file mode 100644 index 0000000..7664718 --- /dev/null +++ b/vendor/guzzle/guzzle/tests/Guzzle/Tests/Service/Command/Factory/ConcreteClassFactoryTest.php @@ -0,0 +1,49 @@ +<?php + +namespace Guzzle\Tests\Service\Command; + +use Guzzle\Tests\Service\Mock\MockClient; +use Guzzle\Service\Command\Factory\ConcreteClassFactory; + +/** + * @covers Guzzle\Service\Command\Factory\ConcreteClassFactory + */ +class ConcreteClassFactoryTest extends \Guzzle\Tests\GuzzleTestCase +{ + public function testProvider() + { + return array( + array('foo', null, 'Guzzle\\Tests\\Service\\Mock\\Command\\'), + array('mock_command', 'Guzzle\Tests\Service\Mock\Command\MockCommand', 'Guzzle\\Tests\\Service\\Mock\\Command\\'), + array('other_command', 'Guzzle\Tests\Service\Mock\Command\OtherCommand', 'Guzzle\\Tests\\Service\\Mock\\Command\\'), + array('sub.sub', 'Guzzle\Tests\Service\Mock\Command\Sub\Sub', 'Guzzle\\Tests\\Service\\Mock\\Command\\'), + array('sub.sub', null, 'Guzzle\\Foo\\'), + array('foo', null, null), + array('mock_command', 'Guzzle\Tests\Service\Mock\Command\MockCommand', null), + array('other_command', 'Guzzle\Tests\Service\Mock\Command\OtherCommand', null), + array('sub.sub', 'Guzzle\Tests\Service\Mock\Command\Sub\Sub', null) + ); + } + + /** + * @dataProvider testProvider + */ + public function testCreatesConcreteCommands($key, $result, $prefix) + { + if (!$prefix) { + $client = new MockClient(); + } else { + $client = new MockClient('', array( + 'command.prefix' => $prefix + )); + } + + $factory = new ConcreteClassFactory($client); + + if (is_null($result)) { + $this->assertNull($factory->factory($key)); + } else { + $this->assertInstanceof($result, $factory->factory($key)); + } + } +} |