diff --git a/.travis.yml b/.travis.yml index 649fb3f..af8a897 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,15 +1,9 @@ language: php dist: trusty php: - - "5.4" - - "5.5" - - "5.6" - - "7.0" - - "7.1" -matrix: - include: - - php: "5.3" - dist: precise + - "7.2" + - "7.3" + - "7.4" install: - composer install script: diff --git a/composer.json b/composer.json index 11848ba..71839a0 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,7 @@ }, "require-dev": { "composer/composer": "^2.0", - "phpunit/phpunit": "4.*", + "phpunit/phpunit": "^8.5.9", "derhasi/tempdirectory": "0.1.*", "squizlabs/php_codesniffer": "2.*", "escapestudios/symfony2-coding-standard": "2.*" diff --git a/tests/FixturesTest.php b/tests/FixturesTest.php index c36bcbc..90aa72c 100644 --- a/tests/FixturesTest.php +++ b/tests/FixturesTest.php @@ -3,11 +3,12 @@ namespace DrupalComposer\PreservePaths\Tests; use derhasi\tempdirectory\TempDirectory; +use PHPUnit\Framework\TestCase; /** * Tests for some examples. */ -class FixturesTest extends \PHPUnit_Framework_TestCase +class FixturesTest extends TestCase { /** @@ -28,7 +29,7 @@ class FixturesTest extends \PHPUnit_Framework_TestCase /** * Set up test. */ - protected function setUp() + protected function setUp(): void { $this->projectRoot = realpath(__DIR__.'/..'); $this->composerBin = realpath(__DIR__.'/../vendor/bin/composer'); @@ -57,7 +58,7 @@ public function testFixtures($folder, $commands = array(), $files = array()) // Add this project as local development repository sow we work with // the latest code. $this->composer('config', 'repositories.dev', 'path', $this->projectRoot); - + $output = $this->composer('install'); // Check for deprecation notices. @@ -67,12 +68,12 @@ public function testFixtures($folder, $commands = array(), $files = array()) foreach ($commands as $command) { call_user_func_array(array($this, 'composer'), $command); } - + // Check for file existance. foreach ($files as $file) { $this->assertFileExists($file); } - + unset($workingDirectory); } @@ -94,7 +95,7 @@ public function fixturesProvider() ), ); } - + /** * Run composer command. * @@ -134,7 +135,7 @@ protected function composer($command) protected function assertDeprecationNotice($lines) { foreach ($lines as $line) { - $this->assertNotContains('Deprecation Notice:', $line); + $this->assertStringNotContainsString('Deprecation Notice:', $line); } } } diff --git a/tests/PathPreserverTest.php b/tests/PathPreserverTest.php index 3ad344c..03aff13 100644 --- a/tests/PathPreserverTest.php +++ b/tests/PathPreserverTest.php @@ -2,27 +2,35 @@ namespace DrupalComposer\PreservePaths\Tests; -use DrupalComposer\PreservePaths\PathPreserver; +use Composer\IO\IOInterface; use Composer\Util\Filesystem; -use Composer\Package\Package; -use Composer\Package\RootPackage; -use Composer\Composer; -use Composer\Config; use derhasi\tempdirectory\TempDirectory; +use DrupalComposer\PreservePaths\PathPreserver; +use PHPUnit\Framework\TestCase; /** * Test for path preserver functionality. */ -class PathPreserverTest extends \PHPUnit_Framework_TestCase +class PathPreserverTest extends TestCase { + /** + * @var \Composer\Util\Filesystem + */ + protected $fs; + + /** + * @var \Composer\IO\IOInterface + */ + protected $io; + /** * set up test environmemt */ - public function setUp() + protected function setUp(): void { $this->fs = new Filesystem(); - $this->io = $this->getMock('Composer\IO\IOInterface'); + $this->io = $this->getMockBuilder(IOInterface::class)->getMock(); } /**