/** * @test */ public function shouldCallParentsCreateMethod() { $factory = new StripeCheckoutPaymentFactory; $container = new ContainerBuilder; $paymentId = $factory->create($container, 'aPaymentName', array( 'publishable_key' => 'aPubKey', 'secret_key' => 'aSecretKey', 'actions' => array('payum.action.foo'), 'apis' => array('payum.api.bar'), 'extensions' => array('payum.extension.ololo'), )); $this->assertDefinitionContainsMethodCall( $container->getDefinition($paymentId), 'addAction', new Reference('payum.action.foo') ); $this->assertDefinitionContainsMethodCall( $container->getDefinition($paymentId), 'addApi', new Reference('payum.api.bar') ); $this->assertDefinitionContainsMethodCall( $container->getDefinition($paymentId), 'addExtension', new Reference('payum.extension.ololo') ); }
/** * @test */ public function shouldAddPayumActionTagToApiObtainCheckoutTokenAction() { $factory = new StripeCheckoutPaymentFactory(); $container = new ContainerBuilder(); $factory->create($container, 'aContextName', array('publishable_key' => 'aPubKey', 'secret_key' => 'aSecretKey', 'obtain_credit_card' => false, 'actions' => array(), 'apis' => array(), 'extensions' => array())); $actionDefinition = $container->getDefinition('payum.stripe.action.api.obtain_checkout_token'); $tagAttributes = $actionDefinition->getTag('payum.action'); $this->assertCount(1, $tagAttributes); $this->assertEquals($factory->getName(), $tagAttributes[0]['factory']); }