diff --git a/.travis.yml b/.travis.yml index 14e697f..e786723 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,6 @@ dist: trusty sudo: false php: - - 7.2 - 7.3 cache: diff --git a/README.md b/README.md index 38fab7c..ef2183d 100644 --- a/README.md +++ b/README.md @@ -69,13 +69,15 @@ $ composer install $ cd tests/Application $ yarn install $ yarn run gulp +$ yarn build $ bin/console assets:install -e test $ bin/console doctrine:database:create -e test $ bin/console doctrine:schema:create -e test $ bin/console server:run 127.0.0.1:8080 -e test $ open http://localhost:8080 -$ bin/behat -$ bin/phpspec run +$ cd ../.. +$ vendor/bin/behat +$ vendor/bin/phpspec run ``` ## Contribution diff --git a/composer.json b/composer.json index 9680a94..3547711 100644 --- a/composer.json +++ b/composer.json @@ -5,34 +5,34 @@ "description": "Przelewy24 payment plugin for Sylius applications.", "license": "MIT", "require": { - "php": "^7.2", - - "sylius/sylius": "^1.6" + "php": "^7.3", + "sylius/sylius": "^1.7" }, "require-dev": { - "behat/behat": "^3.4", - "behat/mink": "^1.7@dev", - "behat/mink-browserkit-driver": "^1.3", - "behat/mink-extension": "^2.2", + "behat/behat": "^3.6.1", "behat/mink-selenium2-driver": "^1.3", + "friends-of-behat/mink": "^1.8", + "friends-of-behat/mink-browserkit-driver": "^1.4", + "friends-of-behat/mink-extension": "^2.4", "friends-of-behat/page-object-extension": "^0.3", "friends-of-behat/suite-settings-extension": "^1.0", "friends-of-behat/symfony-extension": "^2.0", "friends-of-behat/variadic-extension": "^1.1", "lakion/mink-debug-extension": "^1.2.3", - "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", - "sensiolabs/security-checker": "^5.0", - "sylius-labs/coding-standard": "^2.0", - "symfony/browser-kit": "^3.4|^4.1", - "symfony/debug-bundle": "^3.4|^4.1", - "symfony/dotenv": "^4.2", - "symfony/intl": "^3.4|^4.1", - "symfony/web-profiler-bundle": "^3.4|^4.1", - "symfony/web-server-bundle": "^3.4|^4.1" + "phpspec/phpspec": "^6.0", + "phpstan/phpstan-doctrine": "^0.12", + "phpstan/phpstan-shim": "^0.12", + "phpstan/phpstan-symfony": "^0.12", + "phpstan/phpstan-webmozart-assert": "^0.12", + "phpunit/phpunit": "^7.0", + "sensiolabs/security-checker": "^6.0", + "sylius-labs/coding-standard": "^3.0", + "symfony/browser-kit": "^4.4", + "symfony/debug-bundle": "^4.4", + "symfony/intl": "^4.4", + "symfony/web-profiler-bundle": "^4.4", + "symfony/web-server-bundle": "^4.4", + "symfony/dotenv": "^4.4" }, "conflict": { "symfony/symfony": "4.1.8", diff --git a/src/Bridge/Przelewy24BridgeInterface.php b/src/Bridge/Przelewy24BridgeInterface.php index 430c86e..309e093 100644 --- a/src/Bridge/Przelewy24BridgeInterface.php +++ b/src/Bridge/Przelewy24BridgeInterface.php @@ -14,15 +14,23 @@ interface Przelewy24BridgeInterface { - const SANDBOX_ENVIRONMENT = 'sandbox'; - const PRODUCTION_ENVIRONMENT = 'production'; - const SANDBOX_HOST = 'https://sandbox.przelewy24.pl/'; - const PRODUCTION_HOST = 'https://secure.przelewy24.pl/'; - const P24_API_VERSION = '3.2'; - const COMPLETED_STATUS = 'completed'; - const FAILED_STATUS = 'failed'; - const CANCELLED_STATUS = 'cancelled'; - const CREATED_STATUS = 'created'; + public const SANDBOX_ENVIRONMENT = 'sandbox'; + + public const PRODUCTION_ENVIRONMENT = 'production'; + + public const SANDBOX_HOST = 'https://sandbox.przelewy24.pl/'; + + public const PRODUCTION_HOST = 'https://secure.przelewy24.pl/'; + + public const P24_API_VERSION = '3.2'; + + public const COMPLETED_STATUS = 'completed'; + + public const FAILED_STATUS = 'failed'; + + public const CANCELLED_STATUS = 'cancelled'; + + public const CREATED_STATUS = 'created'; public function getTrnRegisterUrl(): string; diff --git a/tests/Application/Kernel.php b/tests/Application/Kernel.php old mode 100755 new mode 100644 index 3145140..56fecdf --- a/tests/Application/Kernel.php +++ b/tests/Application/Kernel.php @@ -86,7 +86,7 @@ protected function getContainerLoader(ContainerInterface $container): LoaderInte Assert::isInstanceOf($container, ContainerBuilder::class); $locator = new FileLocator($this, $this->getRootDir() . '/Resources'); - $resolver = new LoaderResolver(array( + $resolver = new LoaderResolver([ new XmlFileLoader($container, $locator), new YamlFileLoader($container, $locator), new IniFileLoader($container, $locator), @@ -94,7 +94,7 @@ protected function getContainerLoader(ContainerInterface $container): LoaderInte new GlobFileLoader($container, $locator), new DirectoryLoader($container, $locator), new ClosureLoader($container), - )); + ]); return new DelegatingLoader($resolver); } diff --git a/tests/Application/config/bootstrap.php b/tests/Application/config/bootstrap.php old mode 100755 new mode 100644 index 6bb0207..2291ab4 --- a/tests/Application/config/bootstrap.php +++ b/tests/Application/config/bootstrap.php @@ -1,21 +1,23 @@ =1.2) -if (is_array($env = @include dirname(__DIR__).'/.env.local.php')) { +if (is_array($env = @include dirname(__DIR__) . '/.env.local.php')) { $_SERVER += $env; $_ENV += $env; } elseif (!class_exists(Dotenv::class)) { throw new RuntimeException('Please run "composer require symfony/dotenv" to load the ".env" files configuring the application.'); } else { // load all the .env files - (new Dotenv())->loadEnv(dirname(__DIR__).'/.env'); + (new Dotenv())->loadEnv(dirname(__DIR__) . '/.env'); } $_SERVER['APP_ENV'] = $_ENV['APP_ENV'] = ($_SERVER['APP_ENV'] ?? $_ENV['APP_ENV'] ?? null) ?: 'dev'; $_SERVER['APP_DEBUG'] = $_SERVER['APP_DEBUG'] ?? $_ENV['APP_DEBUG'] ?? 'prod' !== $_SERVER['APP_ENV']; -$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; +$_SERVER['APP_DEBUG'] = $_ENV['APP_DEBUG'] = (int) $_SERVER['APP_DEBUG'] || filter_var($_SERVER['APP_DEBUG'], \FILTER_VALIDATE_BOOLEAN) ? '1' : '0'; diff --git a/tests/Application/config/bundles.php b/tests/Application/config/bundles.php old mode 100755 new mode 100644 index 5fac6dc..d0a7190 --- a/tests/Application/config/bundles.php +++ b/tests/Application/config/bundles.php @@ -1,5 +1,7 @@ ['all' => true], Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], @@ -31,9 +33,7 @@ Sylius\Bundle\ResourceBundle\SyliusResourceBundle::class => ['all' => true], Sylius\Bundle\GridBundle\SyliusGridBundle::class => ['all' => true], winzou\Bundle\StateMachineBundle\winzouStateMachineBundle::class => ['all' => true], - Sonata\CoreBundle\SonataCoreBundle::class => ['all' => true], Sonata\BlockBundle\SonataBlockBundle::class => ['all' => true], - Sonata\IntlBundle\SonataIntlBundle::class => ['all' => true], Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle::class => ['all' => true], JMS\SerializerBundle\JMSSerializerBundle::class => ['all' => true], FOS\RestBundle\FOSRestBundle::class => ['all' => true], @@ -44,7 +44,6 @@ Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle::class => ['all' => true], WhiteOctober\PagerfantaBundle\WhiteOctoberPagerfantaBundle::class => ['all' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], - Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle::class => ['all' => true], Sylius\Bundle\FixturesBundle\SyliusFixturesBundle::class => ['all' => true], Sylius\Bundle\PayumBundle\SyliusPayumBundle::class => ['all' => true], Sylius\Bundle\ThemeBundle\SyliusThemeBundle::class => ['all' => true], diff --git a/tests/Application/config/packages/sonata_core.yaml b/tests/Application/config/packages/sonata_core.yaml deleted file mode 100755 index e9a6e89..0000000 --- a/tests/Application/config/packages/sonata_core.yaml +++ /dev/null @@ -1,4 +0,0 @@ -sonata_core: - form: - mapping: - enabled: false diff --git a/tests/Application/config/packages/twig.yaml b/tests/Application/config/packages/twig.yaml index 3b315dc..8545473 100755 --- a/tests/Application/config/packages/twig.yaml +++ b/tests/Application/config/packages/twig.yaml @@ -2,3 +2,11 @@ twig: paths: ['%kernel.project_dir%/templates'] debug: '%kernel.debug%' strict_variables: '%kernel.debug%' + +services: + _defaults: + public: false + autowire: true + autoconfigure: true + + Twig\Extra\Intl\IntlExtension: ~ diff --git a/tests/Application/package.json b/tests/Application/package.json index 14072b2..f1dc816 100755 --- a/tests/Application/package.json +++ b/tests/Application/package.json @@ -1,9 +1,12 @@ { "dependencies": { "babel-polyfill": "^6.26.0", - "jquery": "^3.2.0", + "chart.js": "^2.9.3", + "jquery": "^3.5.0", + "jquery.dirtyforms": "^2.0.0", "lightbox2": "^2.9.0", - "semantic-ui-css": "^2.2.0" + "semantic-ui-css": "^2.2.0", + "slick-carousel": "^1.8.1" }, "devDependencies": { "babel-core": "^6.26.3", diff --git a/tests/Application/public/index.php b/tests/Application/public/index.php old mode 100755 new mode 100644 index 2f8f1b1..748fd5f --- a/tests/Application/public/index.php +++ b/tests/Application/public/index.php @@ -1,10 +1,12 @@ przelewy24ApiMocker->mockApiSuccessfulVerifyTransaction(function () use ($notifyToken, $postData, $captureToken) { $this->client->request('POST', $notifyToken->getTargetUrl(), $postData); - - sleep(1); - - $this->getDriver()->visit($captureToken->getAfterUrl()); + $this->getDriver()->visit($captureToken->getTargetUrl()); }); }