-
-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/master' into feat-promotion
# Conflicts: # phpunit.xml.dist
- Loading branch information
Showing
41 changed files
with
246 additions
and
112 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
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,4 @@ build | |
tests/temp | ||
/.phpunit.result.cache | ||
/.phpunit.cache/test-results | ||
phpunit.xml |
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,65 @@ | ||
# Contributing to Vanilo Framework | ||
|
||
## Running Tests | ||
|
||
By default, tests are ran against an SQLite database. | ||
|
||
If you'd like to run against a real DB engine, the fastest way to do so is to spin up a container for the given | ||
DB engine, and configure a local `phpunit.xml` accordingly | ||
|
||
### MySQL 5.7 | ||
|
||
To spin up a temporary MySQL 5.7 DB use the following command: | ||
|
||
```bash | ||
docker run --name vanilo_test_mysql57 -e MYSQL_ROOT_PASSWORD=mypass123 -d -p 3307:3306 mysql:5.7 | ||
``` | ||
|
||
> You can choose any other container name, password or port instead of the ones in the example above | ||
Then copy `phpunit.xml.dist` to `phpunit.xml` and add the following values before the closing `</phpunit>` tag: | ||
|
||
```xml | ||
<php> | ||
<env name="APP_KEY" value="base64:gm0Aq0Xod/x8Rn2nhZLioYx55ojBcnjzaD4+GQ8M8mM="/> | ||
<env name="APP_ENV" value="testing"/> | ||
<env name="APP_DEBUG" value="true"/> | ||
<env name="BCRYPT_ROUNDS" value="4"/> | ||
<env name="CACHE_DRIVER" value="array"/> | ||
<env name="MAIL_MAILER" value="array"/> | ||
<env name="QUEUE_CONNECTION" value="sync"/> | ||
<env name="SESSION_DRIVER" value="array"/> | ||
<env name="TEST_DB_ENGINE" value="mysql"/> | ||
<env name="TEST_DB_PORT" value="3307"/> | ||
<env name="TEST_DB_PASSWORD" value="mypass123"/> | ||
</php> | ||
``` | ||
|
||
### Postgres | ||
|
||
To spin up a temporary Postgres Database use the following command: | ||
|
||
```bash | ||
docker run --name postgres_test -e POSTGRES_PASSWORD=pgpass123 -d -p 5452:5432 postgres | ||
``` | ||
|
||
> You can choose any other container name, password or port instead of the ones in the example above | ||
Then copy `phpunit.xml.dist` to `phpunit.xml` and add the following values before the closing `</phpunit>` tag: | ||
|
||
```xml | ||
<php> | ||
<env name="APP_KEY" value="base64:gm0Aq0Xod/x8Rn2nhZLioYx55ojBcnjzaD4+GQ8M8mM="/> | ||
<env name="APP_ENV" value="testing"/> | ||
<env name="APP_DEBUG" value="true"/> | ||
<env name="BCRYPT_ROUNDS" value="4"/> | ||
<env name="CACHE_DRIVER" value="array"/> | ||
<env name="MAIL_MAILER" value="array"/> | ||
<env name="QUEUE_CONNECTION" value="sync"/> | ||
<env name="SESSION_DRIVER" value="array"/> | ||
<env name="TEST_DB_ENGINE" value="pgsql"/> | ||
<env name="TEST_DB_PORT" value="5452"/> | ||
<env name="TEST_DB_PASSWORD" value="pgpass123"/> | ||
</php> | ||
``` | ||
|
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,56 +1,59 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" cacheDirectory=".phpunit.cache" backupStaticProperties="false"> | ||
<testsuites> | ||
<testsuite name="Contract Tests"> | ||
<directory>src/Contracts/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Support Tests"> | ||
<directory>src/Support/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Product Tests"> | ||
<directory>src/Product/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Master Product Tests"> | ||
<directory>src/MasterProduct/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Properties Tests"> | ||
<directory>src/Properties/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Promotion Tests"> | ||
<directory>src/Promotion/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Category Tests"> | ||
<directory>src/Category/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Links Tests"> | ||
<directory>src/Links/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Channel Tests"> | ||
<directory>src/Channel/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Cart Tests"> | ||
<directory>src/Cart/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Checkout Tests"> | ||
<directory>src/Checkout/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Order Tests"> | ||
<directory>src/Order/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Payment Tests"> | ||
<directory>src/Payment/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Shipment Tests"> | ||
<directory>src/Shipment/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Adjustments Tests"> | ||
<directory>src/Adjustments/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Taxes Tests"> | ||
<directory>src/Taxes/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Foundation Tests"> | ||
<directory>src/Foundation/Tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" | ||
backupGlobals="false" colors="true" processIsolation="false" stopOnDefect="true" | ||
cacheDirectory=".phpunit.cache" backupStaticProperties="false"> | ||
<testsuites> | ||
<testsuite name="Contract Tests"> | ||
<directory>src/Contracts/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Support Tests"> | ||
<directory>src/Support/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Product Tests"> | ||
<directory>src/Product/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Master Product Tests"> | ||
<directory>src/MasterProduct/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Properties Tests"> | ||
<directory>src/Properties/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Promotion Tests"> | ||
<directory>src/Promotion/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Category Tests"> | ||
<directory>src/Category/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Links Tests"> | ||
<directory>src/Links/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Channel Tests"> | ||
<directory>src/Channel/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Cart Tests"> | ||
<directory>src/Cart/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Checkout Tests"> | ||
<directory>src/Checkout/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Order Tests"> | ||
<directory>src/Order/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Payment Tests"> | ||
<directory>src/Payment/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Shipment Tests"> | ||
<directory>src/Shipment/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Adjustments Tests"> | ||
<directory>src/Adjustments/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Taxes Tests"> | ||
<directory>src/Taxes/Tests</directory> | ||
</testsuite> | ||
<testsuite name="Foundation Tests"> | ||
<directory>src/Foundation/Tests</directory> | ||
</testsuite> | ||
</testsuites> | ||
</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
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
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
Oops, something went wrong.