Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(testing): Simpler unit testing #208

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ docker-php-lint:

# target: phpunit (or docker-phpunit) - Run phpunit tests
phpunit: tools/vendor
phpunit --configuration=./tests/phpunit.xml;
phpunit tests/unit;
docker-phpunit: tools/vendor
@$(call in_docker,make,phpunit)

Expand Down
18 changes: 14 additions & 4 deletions tests/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,18 @@
<?xml version="1.0"?>
<phpunit bootstrap="../vendor/autoload.php" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" beStrictAboutChangesToGlobalState="true" beStrictAboutOutputDuringTests="true" colors="true" executionOrder="random" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd" cacheDirectory=".phpunit.cache">
<phpunit
bootstrap="bootstrap.php"
beStrictAboutChangesToGlobalState="true"
beStrictAboutOutputDuringTests="true"
cacheResult ="false"
colors="true"
executionOrder="random"
stopOnFailure="true">
<php>
<env name="KERNEL_CLASS" value="AppKernel" />
<env name="SYMFONY_DEPRECATIONS_HELPER" value="weak"/>
</php>
<testsuites>
<testsuite name="Ps eventbus Tests">
<directory>./unit</directory>
<testsuite name="Unit">
<directory>.</directory>
</testsuite>
</testsuites>
</phpunit>
9 changes: 2 additions & 7 deletions tests/unit/Decorator/PayloadDecoratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use PrestaShop\Module\PsEventbus\Decorator\PayloadDecorator;
use PrestaShop\Module\PsEventbus\Formatter\DateFormatter;
use PrestaShop\Module\PsEventbus\Tests\System\Tests\BaseTestCase;
use PHPUnit\Framework\TestCase;
use Yandex\Allure\Adapter\Annotation\Features;
use Yandex\Allure\Adapter\Annotation\Stories;
use Yandex\Allure\Adapter\Annotation\Title;
Expand All @@ -12,13 +12,8 @@
*
* @Stories("payload decorator")
*/
class PayloadDecoratorTest extends BaseTestCase
class PayloadDecoratorTest extends TestCase
{
public function setUp(): void
{
parent::setUp();
}

/**
* @Stories("payload decorator")
*
Expand Down
59 changes: 0 additions & 59 deletions tests/unit/Formatter/ArrayFormatterTest.php

This file was deleted.

42 changes: 0 additions & 42 deletions tests/unit/Formatter/JsonFormatterTest.php

This file was deleted.

6 changes: 6 additions & 0 deletions tests/unit/bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?php

$rootDirectory = __DIR__ . '/../../../../';
$projectDir = __DIR__ . '/../../';
require_once $rootDirectory . 'config/config.inc.php';
require_once $projectDir . 'vendor/autoload.php';
Loading