Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update phpspec to stable version, fix failing spec of PurchaseStep #1242

Merged
merged 1 commit into from
Mar 20, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
"symfony-cmf/content-bundle": "1.0.*",
"symfony-cmf/routing-bundle": "1.1.*",
"symfony-cmf/menu-bundle": "1.0.*",
"jackalope/jackalope-doctrine-dbal": "1.0.*"
"jackalope/jackalope-doctrine-dbal": "1.0.*"
},
"require-dev": {
"behat/behat": "~2.4",
Expand All @@ -63,7 +63,7 @@
"behat/mink-selenium2-driver": "*",
"doctrine/doctrine-fixtures-bundle": "2.2.*",
"fzaninotto/faker": "1.2.*",
"phpspec/phpspec": "2.0.*@dev",
"phpspec/phpspec": "~2.0",
"phpunit/phpunit": "~3.7"
},
"provide": {
Expand Down
57 changes: 20 additions & 37 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/Sylius/Bundle/AddressingBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"stof/doctrine-extensions-bundle": "1.1.*"
},
"require-dev": {
"phpspec/phpspec": "2.0.*@dev",
"phpspec/phpspec": "~2.0",
"doctrine/orm": "~2.2",
"symfony/form": "~2.3",
"symfony/validator": "~2.3"
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/CartBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"sylius/resource-bundle": "1.0.*@dev"
},
"require-dev": {
"phpspec/phpspec": "2.0.*@dev",
"phpspec/phpspec": "~2.0",
"symfony/form": "~2.3",
"symfony/validator": "~2.3",
"twig/twig": "~1.0"
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/CoreBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"require-dev": {
"fzaninotto/faker": "1.2.*",
"phpspec/phpspec": "2.0.*@dev",
"phpspec/phpspec": "~2.0",
"symfony/form": "~2.3"
},
"suggest": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@
namespace spec\Sylius\Bundle\CoreBundle\Checkout\Step;

use Doctrine\Common\Persistence\ObjectManager;
use Sylius\Bundle\CoreBundle\Checkout\SyliusCheckoutEvents;
use Payum\Core\PaymentInterface;
use Payum\Core\Registry\RegistryInterface;
use Payum\Core\Security\HttpRequestVerifierInterface;
use Payum\Core\Security\TokenInterface;
use PhpSpec\ObjectBehavior;
use Prophecy\Argument;
use spec\Sylius\Bundle\CoreBundle\Fixture\RequestStack;
use Sylius\Bundle\CartBundle\Provider\CartProviderInterface;
use Sylius\Bundle\CoreBundle\Checkout\SyliusCheckoutEvents;
use Sylius\Bundle\CoreBundle\Model\Order;
use Sylius\Bundle\FlowBundle\Process\Context\ProcessContextInterface;
use Sylius\Bundle\PaymentsBundle\Model\Payment;
Expand All @@ -32,14 +33,16 @@
use Symfony\Component\HttpFoundation\Session\Session;
use Symfony\Component\Translation\TranslatorInterface;

require_once __DIR__.'/../../Fixture/RequestStack.php';

class PurchaseStepSpec extends ObjectBehavior
{
function let(
ContainerInterface $container,
ProcessContextInterface $context,
HttpRequestVerifierInterface $httpRequestVerifier,
TokenInterface $token,
Request $request,
RequestStack $requestStack,
CartProviderInterface $cartProvider,
RegistryInterface $payum,
PaymentInterface $payment,
Expand All @@ -50,6 +53,7 @@ function let(
FlashBagInterface $flashBag,
TranslatorInterface $translator
) {
$requestStack->getCurrentRequest()->willReturn($request);
$session->getFlashBag()->willReturn($flashBag);
$doctrine->getManager()->willReturn($objectManager);
$token->getPaymentName()->willReturn('aPaymentName');
Expand All @@ -59,6 +63,7 @@ function let(

$container->get('payum.security.http_request_verifier')->willReturn($httpRequestVerifier);
$container->get('request')->willReturn($request);
$container->get('request_stack')->willReturn($requestStack);
$container->get('sylius.cart_provider')->willReturn($cartProvider);
$container->get('payum')->willReturn($payum);
$container->get('event_dispatcher')->willReturn($eventDispatcher);
Expand All @@ -85,8 +90,7 @@ function it_extends_checkout_step()
function it_must_dispatch_pre_and_post_payment_state_changed_if_state_changed(
ProcessContextInterface $context,
PaymentInterface $payment,
EventDispatcherInterface $eventDispatcher,
CartProviderInterface $cartProvider
EventDispatcherInterface $eventDispatcher
) {
$paymentModel = new Payment();
$paymentModel->setState(Payment::STATE_NEW);
Expand Down Expand Up @@ -130,8 +134,7 @@ function it_must_dispatch_pre_and_post_payment_state_changed_if_state_changed(
function it_must_not_dispatch_pre_and_post_payment_state_changed_if_state_not_changed(
ProcessContextInterface $context,
PaymentInterface $payment,
EventDispatcherInterface $eventDispatcher,
CartProviderInterface $cartProvider
EventDispatcherInterface $eventDispatcher
) {
$paymentModel = new Payment();
$paymentModel->setState(Payment::STATE_COMPLETED);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace spec\Sylius\Bundle\CoreBundle\Fixture;

use Symfony\Component\HttpFoundation\Request;

class RequestStack
{
private $request;

public function __construct(Request $request)
{
$this->request = $request;
}

public function getCurrentRequest()
{
return $this->request;
}
}
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/InstallerBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"sylius/flow-bundle": "1.0.*@dev"
},
"require-dev": {
"phpspec/phpspec": "2.0.*@dev",
"phpspec/phpspec": "~2.0",
"symfony/form": "~2.2",
"symfony/validator": "~2.2"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/InventoryBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"stof/doctrine-extensions-bundle": "1.1.*"
},
"require-dev": {
"phpspec/phpspec": "2.0.*@dev",
"phpspec/phpspec": "~2.0",
"symfony/form": "~2.3",
"twig/twig": "~1.0"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/MoneyBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"mathiasverraes/money": "*@dev"
},
"require-dev": {
"phpspec/phpspec": "2.0.*@dev",
"phpspec/phpspec": "~2.0",
"twig/twig": "~1.0",
"symfony/form": "~2.3"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/OrderBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"stof/doctrine-extensions-bundle": "1.1.*"
},
"require-dev": {
"phpspec/phpspec": "2.0.*@dev",
"phpspec/phpspec": "~2.0",
"doctrine/orm": "~2.2",
"symfony/form": "~2.3",
"symfony/validator": "~2.3"
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/PaymentsBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"stof/doctrine-extensions-bundle": "1.1.*"
},
"require-dev": {
"phpspec/phpspec": "2.0.*@dev",
"phpspec/phpspec": "~2.0",
"doctrine/orm": "~2.2",
"symfony/form": "~2.3"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/ProductBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"stof/doctrine-extensions-bundle": "1.1.*"
},
"require-dev": {
"phpspec/phpspec": "2.0.*@dev",
"phpspec/phpspec": "~2.0",
"symfony/form": "~2.3",
"symfony/validator": "~2.3"
},
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/PromotionsBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"stof/doctrine-extensions-bundle": "1.1.*"
},
"require-dev": {
"phpspec/phpspec": "2.0.*@dev",
"phpspec/phpspec": "~2.0",
"doctrine/orm": "~2.2",
"symfony/form": "~2.3",
"symfony/validator": "~2.3"
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Bundle/ResourceBundle/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"symfony/form": "~2.3"
},
"require-dev": {
"phpspec/phpspec": "2.0.*@dev",
"phpspec/phpspec": "~2.0",
"twig/twig": "~1.11",
"doctrine/orm": "~2.3",
"doctrine/mongodb-odm": "1.0.*@dev"
Expand Down
Loading