Skip to content

Commit

Permalink
update phpunit
Browse files Browse the repository at this point in the history
  • Loading branch information
OxCom committed Jan 11, 2021
1 parent 2dc2a45 commit b13775d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 36 deletions.
7 changes: 0 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@ sudo: false

matrix:
include:
- php: 5.6
env: MAGENTO_VERSION=^100.0
- php: 5.6
env: MAGENTO_VERSION=^100.1

- php: 7.0
env: MAGENTO_VERSION=^101.0
- php: 7.1
env: MAGENTO_VERSION=^101.0

Expand Down
1 change: 1 addition & 0 deletions Test/.phpunit.result.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
C:37:"PHPUnit\Runner\DefaultTestResultCache":882:{a:2:{s:7:"defects";a:1:{s:97:"OxCom\MagentoCurrencyServices\Test\Model\Currency\Import\SourceTest::testSources with data set #1";i:3;}s:5:"times";a:6:{s:97:"OxCom\MagentoCurrencyServices\Test\Model\Currency\Import\SourceTest::testSources with data set #0";d:1.683;s:97:"OxCom\MagentoCurrencyServices\Test\Model\Currency\Import\SourceTest::testSources with data set #1";d:1.505;s:97:"OxCom\MagentoCurrencyServices\Test\Model\Currency\Import\SourceTest::testSources with data set #2";d:1.111;s:113:"OxCom\MagentoCurrencyServices\Test\Model\Currency\Import\SourceTest::testSourcesWithSameCurrency with data set #0";d:1.002;s:113:"OxCom\MagentoCurrencyServices\Test\Model\Currency\Import\SourceTest::testSourcesWithSameCurrency with data set #1";d:1.002;s:113:"OxCom\MagentoCurrencyServices\Test\Model\Currency\Import\SourceTest::testSourcesWithSameCurrency with data set #2";d:1.002;}}}
22 changes: 15 additions & 7 deletions Test/Model/AbstractTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
namespace OxCom\MagentoCurrencyServices\Test\Model;

use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
use PHPUnit\Framework\TestCase;

/**
* Class AbstractTestCase
*
* @package OxCom\MagentoCurrencyServices\Test\Model
*/
abstract class AbstractTestCase extends \PHPUnit\Framework\TestCase
abstract class AbstractTestCase extends TestCase
{
/**
* @var bool
Expand All @@ -32,12 +33,10 @@ public function __construct($name = null, array $data = [], $dataName = '')
parent::__construct($name, $data, $dataName);
}

/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
public static function setUpBeforeClass(): void
{
parent::setUpBeforeClass();

// every week switch to real or mocked response to avoid loose of source
$date = new \DateTime();
$week = $date->format("W");
Expand All @@ -46,6 +45,15 @@ protected function setUp()
if (static::$isReal) {
\fwrite(STDOUT, "!!! Test will be executed on real sources !!!" . PHP_EOL . PHP_EOL);
}
}

/**
* Sets up the fixture, for example, open a network connection.
* This method is called before a test is executed.
*/
protected function setUp(): void
{
parent::setUp();

$this->om = new ObjectManager($this);
}
Expand All @@ -54,7 +62,7 @@ protected function setUp()
* Tears down the fixture, for example, close a network connection.
* This method is called after a test is executed.
*/
protected function tearDown()
protected function tearDown(): void
{
$this->om = null;
}
Expand Down
41 changes: 19 additions & 22 deletions Test/phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,29 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
backupGlobals="false"
stderr="true"
bootstrap="bootstrap.php"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
colors="true">
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
backupGlobals="false"
stderr="true"
bootstrap="bootstrap.php"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
colors="true">
<coverage>
<include>
<directory>../Model</directory>
</include>
<report>
<clover outputFile="../coverage/clover.xml"/>
<html outputDirectory="../coverage" lowUpperBound="35" highLowerBound="70"/>
</report>
</coverage>
<testsuites>
<testsuite name="CurrencyServices">
<directory suffix="Test.php">Model</directory>
</testsuite>
</testsuites>
<filter>
<whitelist>
<directory>../Model</directory>
</whitelist>
</filter>
<logging>
<log type="coverage-html"
target="../coverage"
lowUpperBound="35"
highLowerBound="70"/>
<log type="coverage-clover" target="../coverage/clover.xml"/>
</logging>
<logging/>
</phpunit>

0 comments on commit b13775d

Please sign in to comment.