diff --git a/Tests/Form/ChoosePaymentMethodTypeTest.php b/Tests/Form/ChoosePaymentMethodTypeTest.php index dec0ccf5..4f7de9e5 100644 --- a/Tests/Form/ChoosePaymentMethodTypeTest.php +++ b/Tests/Form/ChoosePaymentMethodTypeTest.php @@ -3,8 +3,8 @@ namespace JMS\Payment\CoreBundle\Tests\Form\ChoosePaymentMethodTypeTest; use JMS\Payment\CoreBundle\Form\ChoosePaymentMethodType; +use JMS\Payment\CoreBundle\Tests\Functional\TestPlugin\Form\TestPluginType; use JMS\Payment\CoreBundle\Util\Legacy; -use JMS\Payment\PaypalBundle\Form\ExpressCheckoutType; use Symfony\Component\Form\PreloadedExtension; use Symfony\Component\Form\Test\TypeTestCase; use Symfony\Component\HttpKernel\Kernel; @@ -50,7 +50,7 @@ public function testMethodData() $config = $form->get('data_'.$method)->getConfig(); $this->assertInstanceOf( - 'JMS\Payment\PaypalBundle\Form\ExpressCheckoutType', + 'JMS\Payment\CoreBundle\Tests\Functional\TestPlugin\Form\TestPluginType', $config->getType()->getInnerType() ); } @@ -194,7 +194,7 @@ protected function setUp() protected function getExtensions() { - $pluginType = new ExpressCheckoutType(); + $pluginType = new TestPluginType(); if (Legacy::supportsFormTypeClass()) { $pluginTypeName = get_class($pluginType); diff --git a/Tests/Functional/AppKernel.php b/Tests/Functional/AppKernel.php index 0ec32fa8..bd8be997 100644 --- a/Tests/Functional/AppKernel.php +++ b/Tests/Functional/AppKernel.php @@ -2,6 +2,7 @@ namespace JMS\Payment\CoreBundle\Tests\Functional; +use JMS\Payment\CoreBundle\Tests\Functional\TestPlugin\TestPluginBundle; use Symfony\Component\Config\Loader\LoaderInterface; use Symfony\Component\Filesystem\Filesystem; use Symfony\Component\HttpKernel\Kernel; @@ -34,7 +35,7 @@ public function registerBundles() new \Symfony\Bundle\TwigBundle\TwigBundle(), new \JMS\Payment\CoreBundle\Tests\Functional\TestBundle\TestBundle(), new \JMS\Payment\CoreBundle\JMSPaymentCoreBundle(), - new \JMS\Payment\PaypalBundle\JMSPaymentPaypalBundle(), + new TestPluginBundle(), new \Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(), ); } @@ -46,6 +47,11 @@ public function registerContainerConfiguration(LoaderInterface $loader) public function getCacheDir() { - return sys_get_temp_dir().'/JMSPaymentCoreBundle'; + return sys_get_temp_dir().'/JMSPaymentCoreBundle/cache'; + } + + public function getLogDir() + { + return sys_get_temp_dir().'/JMSPaymentCoreBundle/logs'; } } diff --git a/Tests/Functional/BasePaymentWorkflowTest.php b/Tests/Functional/BasePaymentWorkflowTest.php index 6fa5c5d2..a6cbbdc2 100755 --- a/Tests/Functional/BasePaymentWorkflowTest.php +++ b/Tests/Functional/BasePaymentWorkflowTest.php @@ -35,7 +35,7 @@ protected function doTestPaymentDetails() $crawler = $client->request('GET', $router->generate('payment_details', array('id' => $order->getId()))); $form = $crawler->selectButton('submit_btn')->form(); - $form['jms_choose_payment_method[method]']->select('paypal_express_checkout'); + $form['jms_choose_payment_method[method]']->select('test_plugin'); $client->submit($form); $response = $client->getResponse(); diff --git a/Tests/Functional/BasicEntityInteractionsTest.php b/Tests/Functional/BasicEntityInteractionsTest.php index 0f9edea1..c48d4866 100644 --- a/Tests/Functional/BasicEntityInteractionsTest.php +++ b/Tests/Functional/BasicEntityInteractionsTest.php @@ -17,7 +17,7 @@ public function testIndependentCredit() $c = self::$kernel->getContainer(); $ppc = $c->get('payment.plugin_controller'); $em = $c->get('doctrine.orm.entity_manager'); - $instruction = new PaymentInstruction(123.45, 'EUR', 'paypal_express_checkout'); + $instruction = new PaymentInstruction(123.45, 'EUR', 'test_plugin'); $ppc->createPaymentInstruction($instruction); $credit = $ppc->createIndependentCredit($instruction->getId(), 123); diff --git a/Tests/Functional/TestBundle/Controller/OrderController.php b/Tests/Functional/TestBundle/Controller/OrderController.php index ffdb0ac4..06ed6a6d 100755 --- a/Tests/Functional/TestBundle/Controller/OrderController.php +++ b/Tests/Functional/TestBundle/Controller/OrderController.php @@ -33,7 +33,7 @@ public function paymentDetailsAction(Order $order) 'currency' => 'EUR', 'amount' => $order->getAmount(), 'predefined_data' => array( - 'paypal_express_checkout' => array( + 'test_plugin' => array( 'foo' => 'bar', ), ), diff --git a/Tests/Functional/TestBundle/Resources/config/default.yml b/Tests/Functional/TestBundle/Resources/config/default.yml index ae8f3662..e17a56e0 100644 --- a/Tests/Functional/TestBundle/Resources/config/default.yml +++ b/Tests/Functional/TestBundle/Resources/config/default.yml @@ -11,10 +11,3 @@ doctrine: services: em: "@doctrine.orm.entity_manager" - -jms_payment_paypal: - username: schmit_1283340315_biz_api1.gmail.com - password: 1283340321 - signature: A93vj6VJ.ZIRNjbI6GFgi4N2Km.5ATLs-EinlyWk2htEGX0xc3L8YIBo - return_url: http://paypal.test/payment - cancel_url: http://paypal.test/payment diff --git a/Tests/Functional/TestPlugin/DependencyInjection/TestPluginExtension.php b/Tests/Functional/TestPlugin/DependencyInjection/TestPluginExtension.php new file mode 100644 index 00000000..636060b5 --- /dev/null +++ b/Tests/Functional/TestPlugin/DependencyInjection/TestPluginExtension.php @@ -0,0 +1,17 @@ +load('services.yml'); + } +} \ No newline at end of file diff --git a/Tests/Functional/TestPlugin/Form/TestPluginType.php b/Tests/Functional/TestPlugin/Form/TestPluginType.php new file mode 100644 index 00000000..cc232a0a --- /dev/null +++ b/Tests/Functional/TestPlugin/Form/TestPluginType.php @@ -0,0 +1,17 @@ +