Skip to content

Commit

Permalink
plugin-test-suite compat
Browse files Browse the repository at this point in the history
  • Loading branch information
mklaesplenty committed Sep 17, 2018
1 parent fcfc340 commit 9e3308a
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
.idea/
*.iml
.DS_STORE
.env
vendor
coverage
composer.phar
composer.lock
34 changes: 34 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "plentymarkets/plugin-io",
"description": "Plugin IO",
"type": "library",
"autoload": {
"files": [
"utility/plugin_helper.php"
],
"psr-4": {
"IO": "src/"
}
},
"autoload-dev": {
"psr-4": {
"IO\\Tests\\": "tests/"
}
},
"require": {
"php": ">=7.0.0",
"vlucas/phpdotenv": "^2.4"
},
"require-dev": {
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0",
"fzaninotto/faker": "~1.7",
"brianium/paratest": "~1.1"
},
"extra": {
"laravel": {
"providers": [
]
}
}
}
42 changes: 42 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="tests/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<testsuites>
<testsuite name="unit">
<directory>./tests/Unit</directory>
</testsuite>
<testsuite name="integration">
<directory>./tests/Integration</directory>
</testsuite>
<testsuite name="rest">
<directory>./tests/Rest</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="DB_CONNECTION" value="mysql-test"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="SYMFONY_DEPRECATIONS_HELPER" value="disabled"/>
<env name="QUEUE_DRIVER" value="sync"/>
<!-- for queue tests: <env name="QUEUE_DRIVER" value="s3"/> -->

<const name="PLENTY_ID" value="1000"/>
<!--<const name="LANG" value="de"/>-->
<const name="TEST_MODE" value="1" />
<const name="SDOM" value="http://master.plentymarkets.com" />
</php>
<filter>
<whitelist addUncoveredFilesFromWhitelist="true" processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">src/</directory>
</whitelist>
</filter>
</phpunit>
16 changes: 16 additions & 0 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

namespace Plenty\Modules\Plugin\Tests;

use Tests\BrowserKitTestCase;

/**
* Class TestCase
*/
class TestCase extends BrowserKitTestCase
{
protected function setUp()
{
parent::setUp();
}
}
12 changes: 12 additions & 0 deletions tests/autoload.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

require_once __DIR__ . '/../vendor/autoload.php';

$dotenv = new Dotenv\Dotenv(__DIR__ . '/../');
$dotenv->load();

if (!defined('WORKSPACE')) {
define('WORKSPACE', getenv('WORKSPACE') . '/');
}

require_once WORKSPACE. 'pl/bootstrap/autoload_testing.php';

0 comments on commit 9e3308a

Please sign in to comment.