diff --git a/.travis.yml b/.travis.yml index 182647d..bbaf5b7 100755 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/Test/.phpunit.result.cache b/Test/.phpunit.result.cache new file mode 100644 index 0000000..f5c7811 --- /dev/null +++ b/Test/.phpunit.result.cache @@ -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;}}} \ No newline at end of file diff --git a/Test/Model/AbstractTestCase.php b/Test/Model/AbstractTestCase.php index dfb0143..95b9beb 100755 --- a/Test/Model/AbstractTestCase.php +++ b/Test/Model/AbstractTestCase.php @@ -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 @@ -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"); @@ -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); } @@ -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; } diff --git a/Test/phpunit.xml b/Test/phpunit.xml index c9b03ec..104d1fc 100644 --- a/Test/phpunit.xml +++ b/Test/phpunit.xml @@ -1,29 +1,26 @@ - + + + + ../Model + + + + + + Model - - - ../Model - - - - - - +