Skip to content

Commit

Permalink
Merge branch '1.2' into 1.3
Browse files Browse the repository at this point in the history
* 1.2:
  Fixed sorting path while sorting by position
  Remove PHPStan extension for Symfony
  Make PhpSpec passing after fixing PHPStan warnings
  Make PHPStan for specs passing
  Fix spec classnames / filenames mismatches
  Setup spec paths in autoload-dev in the main package
  Update PhpSpec to ^5.0
  • Loading branch information
pamil committed Jan 2, 2019
2 parents 1198a1b + a095c3e commit f130f70
Show file tree
Hide file tree
Showing 16 changed files with 72 additions and 23 deletions.
57 changes: 53 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"zendframework/zend-stdlib": "^3.1"
},
"require-dev": {
"akeneo/phpspec-skip-example-extension": "^3.0",
"akeneo/phpspec-skip-example-extension": "^4.0",
"behat/behat": "^3.2",
"behat/mink": "^1.7@dev",
"behat/mink-browserkit-driver": "^1.3",
Expand All @@ -110,10 +110,9 @@
"matthiasnoback/symfony-dependency-injection-test": "^2.0",
"mikey179/vfsStream": "^1.6",
"pamil/prophecy-common": "^0.1",
"phpspec/phpspec": "^4.0",
"phpspec/phpspec": "^5.0",
"phpstan/phpstan-doctrine": "^0.10",
"phpstan/phpstan-shim": "^0.10",
"phpstan/phpstan-symfony": "^0.10",
"phpstan/phpstan-webmozart-assert": "^0.10",
"phpunit/phpunit": "^6.5",
"sensiolabs/security-checker": "^5.0",
Expand Down Expand Up @@ -202,7 +201,57 @@
},
"autoload-dev": {
"psr-4": {
"Sylius\\Tests\\": "tests/"
"Sylius\\Tests\\": "tests/",
"spec\\Sylius\\Behat\\": "src/Sylius/Behat/spec/",
"spec\\Sylius\\Component\\Addressing\\": "src/Sylius/Component/Addressing/spec/",
"spec\\Sylius\\Component\\Attribute\\": "src/Sylius/Component/Attribute/spec/",
"spec\\Sylius\\Component\\Channel\\": "src/Sylius/Component/Channel/spec/",
"spec\\Sylius\\Component\\Core\\": "src/Sylius/Component/Core/spec/",
"spec\\Sylius\\Component\\Currency\\": "src/Sylius/Component/Currency/spec/",
"spec\\Sylius\\Component\\Customer\\": "src/Sylius/Component/Customer/spec/",
"spec\\Sylius\\Component\\Grid\\": "src/Sylius/Component/Grid/spec/",
"spec\\Sylius\\Component\\Inventory\\": "src/Sylius/Component/Inventory/spec/",
"spec\\Sylius\\Component\\Locale\\": "src/Sylius/Component/Locale/spec/",
"spec\\Sylius\\Component\\Mailer\\": "src/Sylius/Component/Mailer/spec/",
"spec\\Sylius\\Component\\Order\\": "src/Sylius/Component/Order/spec/",
"spec\\Sylius\\Component\\Payment\\": "src/Sylius/Component/Payment/spec/",
"spec\\Sylius\\Component\\Product\\": "src/Sylius/Component/Product/spec/",
"spec\\Sylius\\Component\\Promotion\\": "src/Sylius/Component/Promotion/spec/",
"spec\\Sylius\\Component\\Registry\\": "src/Sylius/Component/Registry/spec/",
"spec\\Sylius\\Component\\Resource\\": "src/Sylius/Component/Resource/spec/",
"spec\\Sylius\\Component\\Review\\": "src/Sylius/Component/Review/spec/",
"spec\\Sylius\\Component\\Shipping\\": "src/Sylius/Component/Shipping/spec/",
"spec\\Sylius\\Component\\Taxation\\": "src/Sylius/Component/Taxation/spec/",
"spec\\Sylius\\Component\\Taxonomy\\": "src/Sylius/Component/Taxonomy/spec/",
"spec\\Sylius\\Component\\User\\": "src/Sylius/Component/User/spec/",
"spec\\Sylius\\Bundle\\AddressingBundle\\": "src/Sylius/Bundle/AddressingBundle/spec/",
"spec\\Sylius\\Bundle\\AdminApiBundle\\": "src/Sylius/Bundle/AdminApiBundle/spec/",
"spec\\Sylius\\Bundle\\AdminBundle\\": "src/Sylius/Bundle/AdminBundle/spec/",
"spec\\Sylius\\Bundle\\AttributeBundle\\": "src/Sylius/Bundle/AttributeBundle/spec/",
"spec\\Sylius\\Bundle\\ChannelBundle\\": "src/Sylius/Bundle/ChannelBundle/spec/",
"spec\\Sylius\\Bundle\\CoreBundle\\": "src/Sylius/Bundle/CoreBundle/spec/",
"spec\\Sylius\\Bundle\\CurrencyBundle\\": "src/Sylius/Bundle/CurrencyBundle/spec/",
"spec\\Sylius\\Bundle\\CustomerBundle\\": "src/Sylius/Bundle/CustomerBundle/spec/",
"spec\\Sylius\\Bundle\\FixturesBundle\\": "src/Sylius/Bundle/FixturesBundle/spec/",
"spec\\Sylius\\Bundle\\GridBundle\\": "src/Sylius/Bundle/GridBundle/spec/",
"spec\\Sylius\\Bundle\\InventoryBundle\\": "src/Sylius/Bundle/InventoryBundle/spec/",
"spec\\Sylius\\Bundle\\LocaleBundle\\": "src/Sylius/Bundle/LocaleBundle/spec/",
"spec\\Sylius\\Bundle\\MailerBundle\\": "src/Sylius/Bundle/MailerBundle/spec/",
"spec\\Sylius\\Bundle\\MoneyBundle\\": "src/Sylius/Bundle/MoneyBundle/spec/",
"spec\\Sylius\\Bundle\\OrderBundle\\": "src/Sylius/Bundle/OrderBundle/spec/",
"spec\\Sylius\\Bundle\\PaymentBundle\\": "src/Sylius/Bundle/PaymentBundle/spec/",
"spec\\Sylius\\Bundle\\PayumBundle\\": "src/Sylius/Bundle/PayumBundle/spec/",
"spec\\Sylius\\Bundle\\ProductBundle\\": "src/Sylius/Bundle/ProductBundle/spec/",
"spec\\Sylius\\Bundle\\PromotionBundle\\": "src/Sylius/Bundle/PromotionBundle/spec/",
"spec\\Sylius\\Bundle\\ResourceBundle\\": "src/Sylius/Bundle/ResourceBundle/spec/",
"spec\\Sylius\\Bundle\\ReviewBundle\\": "src/Sylius/Bundle/ReviewBundle/spec/",
"spec\\Sylius\\Bundle\\ShippingBundle\\": "src/Sylius/Bundle/ShippingBundle",
"spec\\Sylius\\Bundle\\ShopBundle\\": "src/Sylius/Bundle/ShopBundle/spec/",
"spec\\Sylius\\Bundle\\TaxationBundle\\": "src/Sylius/Bundle/TaxationBundle/spec/",
"spec\\Sylius\\Bundle\\TaxonomyBundle\\": "src/Sylius/Bundle/TaxonomyBundle/spec/",
"spec\\Sylius\\Bundle\\ThemeBundle\\": "src/Sylius/Bundle/ThemeBundle/spec/",
"spec\\Sylius\\Bundle\\UiBundle\\": "src/Sylius/Bundle/UiBundle/spec/",
"spec\\Sylius\\Bundle\\UserBundle\\": "src/Sylius/Bundle/UserBundle/spec/"
},
"classmap": ["app/AppKernel.php", "app/TestAppKernel.php", "src/Kernel.php"]
},
Expand Down
10 changes: 5 additions & 5 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
includes:
- vendor/phpstan/phpstan-doctrine/extension.neon
- vendor/phpstan/phpstan-symfony/extension.neon
- vendor/phpstan/phpstan-webmozart-assert/extension.neon

parameters:
reportUnmatchedIgnoredErrors: false

symfony:
container_xml_path: var/cache/dev/srcDevDebugProjectContainer.xml

excludes_analyse:
# Makes PHPStan crash
- '**/DependencyInjection/Configuration.php'

# Test dependencies
- '**/spec/**.php'
- '**/Bundle/*/test/app/**.php'
- '**/Bundle/*/test/src/**.php'
- '**/Bundle/*/Tests/Functional/app/**.php'
Expand All @@ -36,6 +31,11 @@ parameters:
- '/Call to an undefined method Symfony\\Component\\Config\\Definition\\Builder\\NodeParentInterface/'
- '/Call to an undefined method Mockery\\ExpectationInterface|Mockery\\HigherOrderMessage::/'

# PhpSpec related errors
- '/Access to an undefined property spec\\/'
- '/Call to an undefined method spec\\/'
- '/Call to an undefined static method spec\\/'

# These packages aren't in require-dev of the global package
- '/Class Doctrine\\Bundle\\MongoDBBundle/'
- '/Class Doctrine\\Bundle\\PHPCRBundle/'
Expand Down
2 changes: 1 addition & 1 deletion src/Sylius/Behat/spec/Service/Mocker/MockerSpec.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace spec\Sylius\Behat;
namespace spec\Sylius\Behat\Service\Mocker;

use Mockery\MockInterface;
use Payum\Core\Bridge\Guzzle\HttpClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace spec\Sylius\Behat;
namespace spec\Sylius\Behat\Service\Setter;

use PhpSpec\ObjectBehavior;
use Sylius\Behat\Service\Setter\ChannelContextSetter;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function it_validates_attribute_value_based_on_their_type(
$attributeValue->getAttribute()->willReturn($attribute);
$attribute->getConfiguration()->willReturn(['min' => 2, 'max' => 255]);

$attributeType->validate($attributeValue, Argument::any(ExecutionContextInterface::class), ['min' => 2, 'max' => 255])->shouldBeCalled();
$attributeType->validate($attributeValue, Argument::type(ExecutionContextInterface::class), ['min' => 2, 'max' => 255])->shouldBeCalled();

$this->validate($attributeValue, $attributeValueConstraint);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function it_validates_attribute_based_on_its_type_and_set_it_as_required_if_its_
$localeProvider->getDefaultLocaleCode()->willReturn('en_US');
$attributeValue->getLocaleCode()->willReturn('pl');

$attributeType->validate($attributeValue, Argument::any(ExecutionContextInterface::class), ['min' => 2, 'max' => 255])->shouldBeCalled();
$attributeType->validate($attributeValue, Argument::type(ExecutionContextInterface::class), ['min' => 2, 'max' => 255])->shouldBeCalled();

$this->validate($attributeValue, $attributeValueConstraint);
}
Expand All @@ -75,7 +75,7 @@ function it_validates_attribute_value_based_on_its_type_and_do_not_set_it_as_req
$localeProvider->getDefaultLocaleCode()->willReturn('en_US');
$attributeValue->getLocaleCode()->willReturn('en_US');

$attributeType->validate($attributeValue, Argument::any(ExecutionContextInterface::class), ['min' => 2, 'max' => 255, 'required' => true])->shouldBeCalled();
$attributeType->validate($attributeValue, Argument::type(ExecutionContextInterface::class), ['min' => 2, 'max' => 255, 'required' => true])->shouldBeCalled();

$this->validate($attributeValue, $attributeValueConstraint);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class AddToCartCommandSpec extends ObjectBehavior
{
function let(OrderInterface $order, OrderItemInterface $orderItem): void
{
$this->beConstructedThrough('createWithCartAndCartItem', [$order, $orderItem]);
$this->beConstructedWith($order, $orderItem);
}

function it_is_add_cart_item_command(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% set criteria = app.request.query.get('criteria', {}) %}

{% set default_path = path(route, route_parameters|merge({'criteria': criteria})) %}
{% set default_path = path(route, route_parameters|merge({'sorting': null, 'criteria': criteria})) %}
{% set from_a_to_z_path = path(route, route_parameters|merge({'sorting': {'name': 'asc'}, 'criteria': criteria})) %}
{% set from_z_to_a_path = path(route, route_parameters|merge({'sorting': {'name': 'desc'}, 'criteria': criteria})) %}
{% set oldest_first_path = path(route, route_parameters|merge({'sorting': {'createdAt': 'asc'}, 'criteria': criteria})) %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace spec\Sylius\Bundle\ThemeBundle\Translation\Provider;
namespace spec\Sylius\Bundle\ThemeBundle\Translation\Provider\Loader;

use PhpSpec\ObjectBehavior;
use Sylius\Bundle\ThemeBundle\Translation\Provider\Loader\TranslatorLoaderProviderInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace spec\Sylius\Bundle\ThemeBundle\Translation\Provider;
namespace spec\Sylius\Bundle\ThemeBundle\Translation\Provider\Resource;

use PhpSpec\ObjectBehavior;
use Sylius\Bundle\ThemeBundle\Translation\Provider\Resource\TranslatorResourceProviderInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace spec\Sylius\Bundle\ThemeBundle\Translation\Provider;
namespace spec\Sylius\Bundle\ThemeBundle\Translation\Provider\Resource;

use PhpSpec\ObjectBehavior;
use Sylius\Bundle\ThemeBundle\HierarchyProvider\ThemeHierarchyProviderInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace spec\Sylius\Bundle\ThemeBundle\Translation\Provider;
namespace spec\Sylius\Bundle\ThemeBundle\Translation\Provider\Resource;

use PhpSpec\ObjectBehavior;
use Sylius\Bundle\ThemeBundle\Translation\Provider\Resource\TranslatorResourceProviderInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace spec\Sylius\Bundle\ThemeBundle\Translation\Provider;
namespace spec\Sylius\Bundle\ThemeBundle\Translation\Resource;

use PhpSpec\ObjectBehavior;
use Sylius\Bundle\ThemeBundle\Model\ThemeInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace spec\Sylius\Bundle\ThemeBundle\Translation\Provider;
namespace spec\Sylius\Bundle\ThemeBundle\Translation\Resource;

use PhpSpec\ObjectBehavior;
use Sylius\Bundle\ThemeBundle\Translation\Resource\TranslationResourceInterface;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

declare(strict_types=1);

namespace spec\Sylius\Component\Core\Context;
namespace spec\Sylius\Component\Core\Locale\Context;

use PhpSpec\ObjectBehavior;
use Sylius\Component\Channel\Context\ChannelContextInterface;
Expand Down

0 comments on commit f130f70

Please sign in to comment.