-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from mangoweb-sylius/pr/behat
Pr/behat
- Loading branch information
Showing
18 changed files
with
137 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,10 @@ | |
#### Details | ||
|
||
- Behat tests | ||
|
||
## v0.3.1 (2019-07-02) | ||
|
||
#### Details | ||
|
||
- Better tests | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,8 +49,5 @@ | |
"branch-alias": { | ||
"dev-master": "1.2-dev" | ||
} | ||
}, | ||
"config": { | ||
"bin-dir": "bin" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
@cancel_unpaid_orders_for_certain_payment_method | ||
Feature: Cancel unpaid orders for certain payment method | ||
As a administrator / cron | ||
Remove orders that are not paid for a configured period and for certain shipping methods. | ||
This allows to keep unpaid orders which are e.g. to be paid at personal pickup, therefore needs to stay unpaid for a couple of hours / days | ||
In order to cancel unpaid orders which is too old for certain payment method | ||
As an Administrator | ||
I want to cancel orders that are not paid for a configured period and for certain shipping methods | ||
|
||
Background: | ||
Given the store operates on a single channel in "United States" | ||
|
@@ -12,46 +12,54 @@ Feature: Cancel unpaid orders for certain payment method | |
And the store has "DHL" shipping method with "$5.00" fee | ||
And the store allows paying with "Cash on Delivery" | ||
And the store also allows paying with "CSOB" | ||
And the guest customer placed order with number "00000001" with "Screwdriver" product for "[email protected]" and "United States" based shipping address with "DHL" shipping method and "CSOB" payment | ||
And this order is "3" days old | ||
And the guest customer placed order with number "00000002" with "Screwdriver" product for "[email protected]" and "United States" based shipping address with "DHL" shipping method and "Cash on Delivery" payment | ||
And this order is "3" days old | ||
And the guest customer placed order with number "00000003" with "Screwdriver" product for "[email protected]" and "United States" based shipping address with "DHL" shipping method and "CSOB" payment | ||
And this order is "1" days old | ||
And the guest customer placed order with number "00000004" with "Screwdriver" product for "[email protected]" and "United States" based shipping address with "DHL" shipping method and "Cash on Delivery" payment | ||
And this order is "1" days old | ||
And the guest customer placed order with number "00000005" with "Screwdriver" product for "[email protected]" and "United States" based shipping address with "DHL" shipping method and "CSOB" payment | ||
And this order is already paid | ||
And this order is "3" days old | ||
And I run command to cancellation orders | ||
And I am logged in as an administrator | ||
|
||
@ui | ||
Scenario: The order will be canceled, older than limit and payment allowed canceling | ||
Given the guest customer placed order with number "00000001" with "Screwdriver" product for "[email protected]" and "United States" based shipping address with "DHL" shipping method and "CSOB" payment | ||
And this order is "3" days old | ||
And I cancel orders | ||
And I am logged in as an administrator | ||
When I view the summary of the order "00000001" | ||
And its state should be "Cancelled" | ||
Then its state should be "Cancelled" | ||
And it should have payment state "Cancelled" | ||
|
||
@ui | ||
Scenario: The order wont be canceled, older than limit and payment not allowed canceling | ||
Given the guest customer placed order with number "00000002" with "Screwdriver" product for "[email protected]" and "United States" based shipping address with "DHL" shipping method and "Cash on Delivery" payment | ||
And this order is "3" days old | ||
And I cancel orders | ||
And I am logged in as an administrator | ||
When I view the summary of the order "00000002" | ||
And its state should be "New" | ||
Then its state should be "New" | ||
And it should have payment state "New" | ||
|
||
@ui | ||
Scenario: The order wont be canceled, younger than limit and payment allowed canceling | ||
Given the guest customer placed order with number "00000003" with "Screwdriver" product for "[email protected]" and "United States" based shipping address with "DHL" shipping method and "CSOB" payment | ||
And this order is "1" days old | ||
And I cancel orders | ||
And I am logged in as an administrator | ||
When I view the summary of the order "00000003" | ||
And its state should be "New" | ||
Then its state should be "New" | ||
And it should have payment state "New" | ||
|
||
@ui | ||
Scenario: The order wont be canceled, younger than limit and payment not allowed canceling | ||
Given the guest customer placed order with number "00000004" with "Screwdriver" product for "[email protected]" and "United States" based shipping address with "DHL" shipping method and "Cash on Delivery" payment | ||
And this order is "1" days old | ||
And I cancel orders | ||
And I am logged in as an administrator | ||
When I view the summary of the order "00000004" | ||
And its state should be "New" | ||
Then its state should be "New" | ||
And it should have payment state "New" | ||
|
||
@ui | ||
Scenario: The order wont be canceled, already paid | ||
Given the guest customer placed order with number "00000005" with "Screwdriver" product for "[email protected]" and "United States" based shipping address with "DHL" shipping method and "CSOB" payment | ||
And this order is already paid | ||
And this order is "3" days old | ||
And I cancel orders | ||
And I am logged in as an administrator | ||
When I view the summary of the order "00000005" | ||
And its state should be "New" | ||
Then its state should be "New" | ||
And it should have payment state "Completed" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.6/phpunit.xsd" | ||
backupGlobals="false" | ||
colors="true" | ||
bootstrap="vendor/autoload.php"> | ||
<testsuites> | ||
<testsuite name="AcmeSyliusExamplePlugin Test Suite"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/5.6/phpunit.xsd" | ||
backupGlobals="false" | ||
colors="true" | ||
bootstrap="vendor/autoload.php"> | ||
<testsuites> | ||
<testsuite name="AcmeSyliusExamplePlugin Test Suite"> | ||
<directory>tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
|
||
<php> | ||
<server name="KERNEL_CLASS_PATH" value="/tests/Application/src/Kernel.php" /> | ||
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true" /> | ||
</php> | ||
<php> | ||
<server name="KERNEL_CLASS_PATH" value="/tests/Application/src/Kernel.php"/> | ||
<server name="IS_DOCTRINE_ORM_SUPPORTED" value="true"/> | ||
<env name="APP_SECRET" value="''"/> | ||
</php> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
use App\Kernel; | ||
use Symfony\Component\Debug\Debug; | ||
use Symfony\Component\Dotenv\Dotenv; | ||
use Symfony\Component\HttpFoundation\Request; | ||
|
||
require __DIR__ . '/../../../vendor/autoload.php'; | ||
|
||
// The check is to ensure we don't use .env in production | ||
if (!isset($_SERVER['APP_ENV'])) { | ||
if (!class_exists(Dotenv::class)) { | ||
throw new \RuntimeException('APP_ENV environment variable is not defined. You need to define environment variables for configuration or add "symfony/dotenv" as a Composer dependency to load variables from a .env file.'); | ||
} | ||
(new Dotenv())->load(__DIR__ . '/../.env'); | ||
} | ||
|
||
$env = $_SERVER['APP_ENV'] ?? 'dev'; | ||
$debug = (bool) ($_SERVER['APP_DEBUG'] ?? ($env !== 'prod')); | ||
|
||
if ($debug) { | ||
umask(0000); | ||
|
||
Debug::enable(); | ||
} | ||
|
||
if ($trustedProxies = $_SERVER['TRUSTED_PROXIES'] ?? false) { | ||
Request::setTrustedProxies(explode(',', $trustedProxies), Request::HEADER_X_FORWARDED_ALL ^ Request::HEADER_X_FORWARDED_HOST); | ||
} | ||
|
||
if ($trustedHosts = $_SERVER['TRUSTED_HOSTS'] ?? false) { | ||
Request::setTrustedHosts(explode(',', $trustedHosts)); | ||
} | ||
|
||
$kernel = new Kernel($env, $debug); | ||
$request = Request::createFromGlobals(); | ||
$response = $kernel->handle($request); | ||
$response->send(); | ||
$kernel->terminate($request, $response); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters