| @@ 16-70 (lines=55) @@ | ||
| 13 | ||
| 14 | use Octante\UpsAPIBundle\Services\AddressValidationFactory; |
|
| 15 | ||
| 16 | class AddressValidationFactoryTest extends \PHPUnit_Framework_TestCase |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * when: createIsCalled |
|
| 20 | * should: returnAnUpsAddressValidationInstance. |
|
| 21 | */ |
|
| 22 | public function testReturnUpsAddressValidationInstance() |
|
| 23 | { |
|
| 24 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 25 | $upsAddressValidationInstance = AddressValidationFactory::create( |
|
| 26 | 'accessKey', |
|
| 27 | 'userId', |
|
| 28 | 'password', |
|
| 29 | $loggerMock |
|
| 30 | ); |
|
| 31 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\AddressValidationWrapper', $upsAddressValidationInstance); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * when: createIsCalled |
|
| 36 | * with: useIntegration |
|
| 37 | * should: returnAnUpsAddressValidationInstanceWithUseIntegrationActivated. |
|
| 38 | */ |
|
| 39 | public function testReturnUpsAddressValidationInstanceUsingIntegrationParameter() |
|
| 40 | { |
|
| 41 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 42 | $upsAddressValidationInstance = AddressValidationFactory::create( |
|
| 43 | 'accessKey', |
|
| 44 | 'userId', |
|
| 45 | 'password', |
|
| 46 | $loggerMock, |
|
| 47 | true |
|
| 48 | ); |
|
| 49 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\AddressValidationWrapper', $upsAddressValidationInstance); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * when: createIsCalled |
|
| 54 | * with: aRequestClass |
|
| 55 | * should: returnAnUpsAddressValidationInstanceWithARequestObject. |
|
| 56 | */ |
|
| 57 | public function testReturnUpsAddressValidationInstanceUsingARequestClass() |
|
| 58 | { |
|
| 59 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 60 | $upsAddressValidationInstance = AddressValidationFactory::create( |
|
| 61 | 'accessKey', |
|
| 62 | 'userId', |
|
| 63 | 'password', |
|
| 64 | $loggerMock, |
|
| 65 | false, |
|
| 66 | 'Ups\Request' |
|
| 67 | ); |
|
| 68 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\AddressValidationWrapper', $upsAddressValidationInstance); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||
| @@ 16-70 (lines=55) @@ | ||
| 13 | ||
| 14 | use Octante\UpsAPIBundle\Services\LocatorFactory; |
|
| 15 | ||
| 16 | class LocatorFactoryTest extends \PHPUnit_Framework_TestCase |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * when: createIsCalled |
|
| 20 | * should: returnAnUpsLocatorInstance. |
|
| 21 | */ |
|
| 22 | public function testReturnUpsLocatorInstance() |
|
| 23 | { |
|
| 24 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 25 | $upsLocatorInstance = LocatorFactory::create( |
|
| 26 | 'accessKey', |
|
| 27 | 'userId', |
|
| 28 | 'password', |
|
| 29 | $loggerMock |
|
| 30 | ); |
|
| 31 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\LocatorWrapper', $upsLocatorInstance); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * when: createIsCalled |
|
| 36 | * with: useIntegration |
|
| 37 | * should: returnAnUpsLocatorInstanceWithUseIntegrationActivated. |
|
| 38 | */ |
|
| 39 | public function testReturnUpsLocatorInstanceUsingIntegrationParameter() |
|
| 40 | { |
|
| 41 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 42 | $upsLocatorInstance = LocatorFactory::create( |
|
| 43 | 'accessKey', |
|
| 44 | 'userId', |
|
| 45 | 'password', |
|
| 46 | $loggerMock, |
|
| 47 | true |
|
| 48 | ); |
|
| 49 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\LocatorWrapper', $upsLocatorInstance); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * when: createIsCalled |
|
| 54 | * with: aRequestClass |
|
| 55 | * should: returnAnUpsLocatorInstanceWithARequestObject. |
|
| 56 | */ |
|
| 57 | public function testReturnUpsLocatorInstanceUsingARequestClass() |
|
| 58 | { |
|
| 59 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 60 | $upsLocatorInstance = LocatorFactory::create( |
|
| 61 | 'accessKey', |
|
| 62 | 'userId', |
|
| 63 | 'password', |
|
| 64 | $loggerMock, |
|
| 65 | false, |
|
| 66 | 'Ups\Request' |
|
| 67 | ); |
|
| 68 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\LocatorWrapper', $upsLocatorInstance); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||
| @@ 16-70 (lines=55) @@ | ||
| 13 | ||
| 14 | use Octante\UpsAPIBundle\Services\QuantumViewFactory; |
|
| 15 | ||
| 16 | class QuantumViewFactoryTest extends \PHPUnit_Framework_TestCase |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * when: createIsCalled |
|
| 20 | * should: returnAnUpsQuantumViewInstance. |
|
| 21 | */ |
|
| 22 | public function testReturnUpsQuantumViewInstance() |
|
| 23 | { |
|
| 24 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 25 | $upsQuantumViewInstance = QuantumViewFactory::create( |
|
| 26 | 'accessKey', |
|
| 27 | 'userId', |
|
| 28 | 'password', |
|
| 29 | $loggerMock |
|
| 30 | ); |
|
| 31 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\QuantumViewWrapper', $upsQuantumViewInstance); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * when: createIsCalled |
|
| 36 | * with: useIntegration |
|
| 37 | * should: returnAnUpsQuantumViewInstanceWithUseIntegrationActivated. |
|
| 38 | */ |
|
| 39 | public function testReturnUpsQuantumViewInstanceUsingIntegrationParameter() |
|
| 40 | { |
|
| 41 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 42 | $upsQuantumViewInstance = QuantumViewFactory::create( |
|
| 43 | 'accessKey', |
|
| 44 | 'userId', |
|
| 45 | 'password', |
|
| 46 | $loggerMock, |
|
| 47 | true |
|
| 48 | ); |
|
| 49 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\QuantumViewWrapper', $upsQuantumViewInstance); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * when: createIsCalled |
|
| 54 | * with: aRequestClass |
|
| 55 | * should: returnAnUpsQuantumViewInstanceWithARequestObject. |
|
| 56 | */ |
|
| 57 | public function testReturnUpsQuantumViewInstanceUsingARequestClass() |
|
| 58 | { |
|
| 59 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 60 | $upsQuantumViewInstance = QuantumViewFactory::create( |
|
| 61 | 'accessKey', |
|
| 62 | 'userId', |
|
| 63 | 'password', |
|
| 64 | $loggerMock, |
|
| 65 | false, |
|
| 66 | 'Ups\Request' |
|
| 67 | ); |
|
| 68 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\QuantumViewWrapper', $upsQuantumViewInstance); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||
| @@ 16-70 (lines=55) @@ | ||
| 13 | ||
| 14 | use Octante\UpsAPIBundle\Services\ShippingFactory; |
|
| 15 | ||
| 16 | class ShippingFactoryTest extends \PHPUnit_Framework_TestCase |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * when: createIsCalled |
|
| 20 | * should: returnAnUpsShippingInstance. |
|
| 21 | */ |
|
| 22 | public function testReturnUpsShippingInstance() |
|
| 23 | { |
|
| 24 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 25 | $upsShippingInstance = ShippingFactory::create( |
|
| 26 | 'accessKey', |
|
| 27 | 'userId', |
|
| 28 | 'password', |
|
| 29 | $loggerMock |
|
| 30 | ); |
|
| 31 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\ShippingWrapper', $upsShippingInstance); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * when: createIsCalled |
|
| 36 | * with: useIntegration |
|
| 37 | * should: returnAnUpsShippingInstanceWithUseIntegrationActivated. |
|
| 38 | */ |
|
| 39 | public function testReturnUpsShippingInstanceUsingIntegrationParameter() |
|
| 40 | { |
|
| 41 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 42 | $upsShippingInstance = ShippingFactory::create( |
|
| 43 | 'accessKey', |
|
| 44 | 'userId', |
|
| 45 | 'password', |
|
| 46 | $loggerMock, |
|
| 47 | true |
|
| 48 | ); |
|
| 49 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\ShippingWrapper', $upsShippingInstance); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * when: createIsCalled |
|
| 54 | * with: aRequestClass |
|
| 55 | * should: returnAnUpsShippingInstanceWithARequestObject. |
|
| 56 | */ |
|
| 57 | public function testReturnUpsShippingInstanceUsingARequestClass() |
|
| 58 | { |
|
| 59 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 60 | $upsShippingInstance = ShippingFactory::create( |
|
| 61 | 'accessKey', |
|
| 62 | 'userId', |
|
| 63 | 'password', |
|
| 64 | $loggerMock, |
|
| 65 | false, |
|
| 66 | 'Ups\Request' |
|
| 67 | ); |
|
| 68 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\ShippingWrapper', $upsShippingInstance); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||
| @@ 16-70 (lines=55) @@ | ||
| 13 | ||
| 14 | use Octante\UpsAPIBundle\Services\TimeInTransitFactory; |
|
| 15 | ||
| 16 | class TimeInTransitFactoryTest extends \PHPUnit_Framework_TestCase |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * when: createIsCalled |
|
| 20 | * should: returnAnUpsTimeInTransitInstance. |
|
| 21 | */ |
|
| 22 | public function testReturnUpsTimeInTransitInstance() |
|
| 23 | { |
|
| 24 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 25 | $upsTimeInTransitInstance = TimeInTransitFactory::create( |
|
| 26 | 'accessKey', |
|
| 27 | 'userId', |
|
| 28 | 'password', |
|
| 29 | $loggerMock |
|
| 30 | ); |
|
| 31 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\TimeInTransitWrapper', $upsTimeInTransitInstance); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * when: createIsCalled |
|
| 36 | * with: useIntegration |
|
| 37 | * should: returnAnUpsTimeInTransitInstanceWithUseIntegrationActivated. |
|
| 38 | */ |
|
| 39 | public function testReturnUpsTimeInTransitInstanceUsingIntegrationParameter() |
|
| 40 | { |
|
| 41 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 42 | $upsTimeInTransitInstance = TimeInTransitFactory::create( |
|
| 43 | 'accessKey', |
|
| 44 | 'userId', |
|
| 45 | 'password', |
|
| 46 | $loggerMock, |
|
| 47 | true |
|
| 48 | ); |
|
| 49 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\TimeInTransitWrapper', $upsTimeInTransitInstance); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * when: createIsCalled |
|
| 54 | * with: aRequestClass |
|
| 55 | * should: returnAnUpsTimeInTransitInstanceWithARequestObject. |
|
| 56 | */ |
|
| 57 | public function testReturnUpsTimeInTransitInstanceUsingARequestClass() |
|
| 58 | { |
|
| 59 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 60 | $upsTimeInTransitInstance = TimeInTransitFactory::create( |
|
| 61 | 'accessKey', |
|
| 62 | 'userId', |
|
| 63 | 'password', |
|
| 64 | $loggerMock, |
|
| 65 | false, |
|
| 66 | 'Ups\Request' |
|
| 67 | ); |
|
| 68 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\TimeInTransitWrapper', $upsTimeInTransitInstance); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||
| @@ 16-70 (lines=55) @@ | ||
| 13 | ||
| 14 | use Octante\UpsAPIBundle\Services\TrackingFactory; |
|
| 15 | ||
| 16 | class TrackingFactoryTest extends \PHPUnit_Framework_TestCase |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * when: createIsCalled |
|
| 20 | * should: returnAnUpsTrackingInstance. |
|
| 21 | */ |
|
| 22 | public function testReturnUpsTrackingInstance() |
|
| 23 | { |
|
| 24 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 25 | $upsTrackingInstance = TrackingFactory::create( |
|
| 26 | 'accessKey', |
|
| 27 | 'userId', |
|
| 28 | 'password', |
|
| 29 | $loggerMock |
|
| 30 | ); |
|
| 31 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\TrackingWrapper', $upsTrackingInstance); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * when: createIsCalled |
|
| 36 | * with: useIntegration |
|
| 37 | * should: returnAnUpsTrackingInstanceWithUseIntegrationActivated. |
|
| 38 | */ |
|
| 39 | public function testReturnUpsTrackingInstanceUsingIntegrationParameter() |
|
| 40 | { |
|
| 41 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 42 | $upsTrackingInstance = TrackingFactory::create( |
|
| 43 | 'accessKey', |
|
| 44 | 'userId', |
|
| 45 | 'password', |
|
| 46 | $loggerMock, |
|
| 47 | true |
|
| 48 | ); |
|
| 49 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\TrackingWrapper', $upsTrackingInstance); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * when: createIsCalled |
|
| 54 | * with: aRequestClass |
|
| 55 | * should: returnAnUpsTrackingInstanceWithARequestObject. |
|
| 56 | */ |
|
| 57 | public function testReturnUpsTrackingInstanceUsingARequestClass() |
|
| 58 | { |
|
| 59 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 60 | $upsTrackingInstance = TrackingFactory::create( |
|
| 61 | 'accessKey', |
|
| 62 | 'userId', |
|
| 63 | 'password', |
|
| 64 | $loggerMock, |
|
| 65 | false, |
|
| 66 | 'Ups\Request' |
|
| 67 | ); |
|
| 68 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\TrackingWrapper', $upsTrackingInstance); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||
| @@ 16-70 (lines=55) @@ | ||
| 13 | ||
| 14 | use Octante\UpsAPIBundle\Services\TradeabilityFactory; |
|
| 15 | ||
| 16 | class TradeabilityFactoryTest extends \PHPUnit_Framework_TestCase |
|
| 17 | { |
|
| 18 | /** |
|
| 19 | * when: createIsCalled |
|
| 20 | * should: returnAnUpsTradeabilityInstance. |
|
| 21 | */ |
|
| 22 | public function testReturnUpsTradeabilityInstance() |
|
| 23 | { |
|
| 24 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 25 | $upsTradeabilityInstance = TradeabilityFactory::create( |
|
| 26 | 'accessKey', |
|
| 27 | 'userId', |
|
| 28 | 'password', |
|
| 29 | $loggerMock |
|
| 30 | ); |
|
| 31 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\TradeabilityWrapper', $upsTradeabilityInstance); |
|
| 32 | } |
|
| 33 | ||
| 34 | /** |
|
| 35 | * when: createIsCalled |
|
| 36 | * with: useIntegration |
|
| 37 | * should: returnAnUpsTradeabilityInstanceWithUseIntegrationActivated. |
|
| 38 | */ |
|
| 39 | public function testReturnUpsTradeabilityInstanceUsingIntegrationParameter() |
|
| 40 | { |
|
| 41 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 42 | $upsTradeabilityInstance = TradeabilityFactory::create( |
|
| 43 | 'accessKey', |
|
| 44 | 'userId', |
|
| 45 | 'password', |
|
| 46 | $loggerMock, |
|
| 47 | true |
|
| 48 | ); |
|
| 49 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\TradeabilityWrapper', $upsTradeabilityInstance); |
|
| 50 | } |
|
| 51 | ||
| 52 | /** |
|
| 53 | * when: createIsCalled |
|
| 54 | * with: aRequestClass |
|
| 55 | * should: returnAnUpsTradeabilityInstanceWithARequestObject. |
|
| 56 | */ |
|
| 57 | public function testReturnUpsTradeabilityInstanceUsingARequestClass() |
|
| 58 | { |
|
| 59 | $loggerMock = $this->getMock('Psr\Log\LoggerInterface'); |
|
| 60 | $upsTradeabilityInstance = TradeabilityFactory::create( |
|
| 61 | 'accessKey', |
|
| 62 | 'userId', |
|
| 63 | 'password', |
|
| 64 | $loggerMock, |
|
| 65 | false, |
|
| 66 | 'Ups\Request' |
|
| 67 | ); |
|
| 68 | $this->assertInstanceOf('Octante\UpsAPIBundle\Library\TradeabilityWrapper', $upsTradeabilityInstance); |
|
| 69 | } |
|
| 70 | } |
|
| 71 | ||