diff --git a/.gitignore b/.gitignore index aece1c3..19566b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,18 @@ -.idea/ -.vagrant/ -bin/ -vendor/ -var/ -/node_modules/ -test/fixtures/var/ -test/fixtures/web/ -package-lock.json +# Files composer.lock -yarn.lock composer.phar +package-lock.json +yarn.lock /test/Bundler/dev1-cache /test/Bundler/dev2-cache/eb43a_dev2.require.js.sources + +# Folders +/.idea/ +/.vagrant/ +/bin/ +/coverage/ +/node_modules/ +/tests/fixtures/var/ +/tests/fixtures/web/ +/var/ +/vendor/ diff --git a/.travis.yml b/.travis.yml index 5a556a4..df26a57 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,5 @@ language: php -node_js: - - "node" - - "8" - sudo: false cache: @@ -13,41 +9,41 @@ cache: matrix: include: - # PHP 7.1 tests + # PHP 7.2 tests - language: php - php: 7.1 + php: 7.2 env: COMPOSER_FLAGS="--prefer-lowest" before_script: - composer update $COMPOSER_FLAGS --prefer-dist script: vendor/bin/phpunit - language: php - php: 7.1 + php: 7.2 env: COMPOSER_FLAGS="--prefer-stable" before_script: - composer update $COMPOSER_FLAGS --prefer-dist script: vendor/bin/phpunit - language: php - php: 7.1 + php: 7.2 env: COMPOSER_FLAGS="" before_script: - composer update $COMPOSER_FLAGS --prefer-dist script: vendor/bin/phpunit - language: php - php: 7.1 + php: 7.2 env: SYMFONY_VERSION="4.0.*" before_script: - composer update $COMPOSER_FLAGS --prefer-dist script: vendor/bin/phpunit - # PHP 7.2 tests + # PHP 7.3 tests - language: php - php: 7.2 + php: 7.3 env: COMPOSER_FLAGS="" before_script: - composer update $COMPOSER_FLAGS --prefer-dist script: vendor/bin/phpunit - language: php - php: 7.2 + php: 7.3 env: SYMFONY_VERSION="4.0.*" before_script: - composer update $COMPOSER_FLAGS --prefer-dist @@ -55,6 +51,6 @@ matrix: # JS tests - language: node_js - node_js: 8.5.0 + node_js: node # Latest env: YARN_TEST="TRUE" script: npm test diff --git a/README.md b/README.md index 9c6cd84..01089ca 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,10 @@ -THIS PROJECT IS WORK IN PROGRESS, NOTHING IS FINAL! USE AT OWN RISK. +# hostnet/asset-lib +[![Travis Status](https://travis-ci.org/hostnet/asset-lib.svg?branch=master)](https://travis-ci.org/hostnet/asset-lib) +[![AppVeyor Status](https://ci.appveyor.com/api/projects/status/github/hostnet/asset-lib?svg=true)](https://ci.appveyor.com/project/yannickl88/asset-lib) -# hostnet/resolver-lib -Resolver for assets +> This project is work in progress, nothing is final! Use at own risk. + +An asset resolver inspired by webpack. This is used in conjunction with Symfony and the [asset-bundle](https://github.com/hostnet/asset-bundle). ## Assumptions: - - `node_modules` folder is always at ./, so: `./node_modules` +This library makes a single assumption, the `node_modules` should always be at the root of a project (so: `./node_modules`). diff --git a/composer.json b/composer.json index 609a01d..d07f749 100644 --- a/composer.json +++ b/composer.json @@ -4,18 +4,18 @@ "description": "Tool for finding all dependencies given a set of input files.", "license": "MIT", "require": { - "php": ">=7.1", - "psr/log": "^1.0", - "psr/simple-cache": "^1.0", - "symfony/console": "^4.0|^3.3", - "symfony/event-dispatcher": "^4.0|^3.3" + "php": ">=7.2", + "psr/log": "^1.0.0", + "psr/simple-cache": "^1.0.0", + "symfony/console": "^4.0.0", + "symfony/event-dispatcher": "^4.0.0" }, "require-dev": { - "hostnet/phpcs-tool": "^6.0.2", - "mikey179/vfsStream": "^1.6", - "phpunit/phpunit": "^6.2", - "symfony/phpunit-bridge": "^4.0", - "symfony/process": "^4.0|^3.3" + "hostnet/phpcs-tool": "^8.3.3", + "mikey179/vfsstream": "^1.6.6", + "phpunit/phpunit": "^8.1.3", + "symfony/phpunit-bridge": "^4.2.8", + "symfony/process": "^4.2.8" }, "autoload": { "psr-4": { @@ -24,7 +24,7 @@ }, "autoload-dev": { "psr-4": { - "Hostnet\\Component\\Resolver\\": "test/" + "Hostnet\\Component\\Resolver\\": "tests/" } } } diff --git a/package.json b/package.json index e31fa09..50b2c8e 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,15 @@ { - "name": "resolver-lib", - "version": "1.0.0", - "description": "THIS PROJECT IS WORK IN PROGRESS, NOTHING IS FINAL! USE AT OWN RISK.", + "name": "asset-lib", + "version": "0.3.0", + "description": "An asset resolver inspired by webpack (WIP)", "repository": { "type": "git", - "url": "git+https://github.com/hostnet/resolver-lib.git" + "url": "git+https://github.com/hostnet/asset-lib.git" }, "author": "Hostnet BV.", "license": "MIT", "bugs": { - "url": "https://github.com/hostnet/resolver-lib/issues" + "url": "https://github.com/hostnet/asset-lib/issues" }, "scripts": { "test": "node_modules/.bin/jasmine", @@ -18,16 +18,16 @@ }, "dependencies": { "brotli": "1.3.2", - "clean-css": "^4.1.9", - "less": "^3.8.0", + "clean-css": "^4.2.1", + "less": "^3.9.0", "split": "^1.0.1", "terser": "^3.17.0", - "typescript": "^2.5.0" + "typescript": "^3.4.5" }, "devDependencies": { "istanbul": "^0.4.5", - "jasmine": "^2.0.0", + "jasmine": "^3.4.0", "jasmine-promises": "^0.4.1" }, - "homepage": "https://github.com/hostnet/resolver-lib#readme" + "homepage": "https://github.com/hostnet/asset-lib" } diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 844b087..096d51d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,8 +1,12 @@ - + - - ./test + + ./tests @@ -13,6 +17,6 @@ - + diff --git a/src/Builder/Asset.php b/src/Builder/Asset.php index f1aca0d..64a0c32 100644 --- a/src/Builder/Asset.php +++ b/src/Builder/Asset.php @@ -28,10 +28,10 @@ final class Asset */ public function __construct(DependencyNodeInterface $file) { - $this->file = $file->getFile(); - $this->files = []; + $this->file = $file->getFile(); + $this->files = []; - $walker = new TreeWalker(function (DependencyNodeInterface $dependency) { + $walker = new TreeWalker(function (DependencyNodeInterface $dependency): void { $this->files[] = $dependency; }); diff --git a/src/Builder/BuildConfig.php b/src/Builder/BuildConfig.php index 53704a4..11d9545 100644 --- a/src/Builder/BuildConfig.php +++ b/src/Builder/BuildConfig.php @@ -18,9 +18,9 @@ class BuildConfig implements \JsonSerializable /** * @var AbstractBuildStep[] */ - private $steps = []; - private $writers = []; - private $actions = []; + private $steps = []; + private $writers = []; + private $actions = []; private $extension_mapping = []; private $paths; private $checksum; @@ -103,8 +103,8 @@ public function compile(): void } $supported_extensions = []; - $edges = []; - $i = 0; + $edges = []; + $i = 0; foreach ($this->steps as $step) { $ext = $step->acceptedExtension(); @@ -210,7 +210,7 @@ private function findPaths(array $edges, int $starting_state, int $ending_state) $visitable_edges = array_values(array_filter($edges, function (array $edge) use ($starting_state) { return $edge[1] === $starting_state; })); - $seen = array_column($visitable_edges, 0); + $seen = array_column($visitable_edges, 0); while (true) { $has_changed = false; @@ -224,9 +224,9 @@ private function findPaths(array $edges, int $starting_state, int $ending_state) continue; } - $has_changed = true; + $has_changed = true; $visitable_edges[] = $edge; - $seen[] = $edge[0]; + $seen[] = $edge[0]; } } @@ -239,7 +239,7 @@ private function findPaths(array $edges, int $starting_state, int $ending_state) $visitable_edges_r = array_values(array_filter($visitable_edges, function (array $edge) use ($ending_state) { return $edge[3] === $ending_state; })); - $seen = array_column($visitable_edges_r, 0); + $seen = array_column($visitable_edges_r, 0); while (true) { $has_changed = false; @@ -253,9 +253,9 @@ private function findPaths(array $edges, int $starting_state, int $ending_state) continue; } - $has_changed = true; + $has_changed = true; $visitable_edges_r[] = $edge; - $seen[] = $edge[0]; + $seen[] = $edge[0]; } } @@ -289,8 +289,8 @@ private function findLongestPath(array $edges, string $extension, int $starting_ $options[] = $edge; } - $plan = $this->makeChoices($options, $edges, $ending_state); - $seen_edges = array_column($options, 0); + $plan = $this->makeChoices($options, $edges, $ending_state); + $seen_edges = array_column($options, 0); $seen_actions = array_column($options, 5); if (empty($plan)) { @@ -322,9 +322,9 @@ private function findLongestPath(array $edges, string $extension, int $starting_ continue; } - $has_changed = true; - $plan = array_merge($plan, $this->makeChoices($options, $edges, $ending_state)); - $seen_edges = array_merge($seen_edges, array_column($options, 0)); + $has_changed = true; + $plan = array_merge($plan, $this->makeChoices($options, $edges, $ending_state)); + $seen_edges = array_merge($seen_edges, array_column($options, 0)); $seen_actions = array_merge($seen_edges, array_column($options, 5)); } diff --git a/src/Builder/BuildFiles.php b/src/Builder/BuildFiles.php index faa2cae..91449f6 100644 --- a/src/Builder/BuildFiles.php +++ b/src/Builder/BuildFiles.php @@ -24,7 +24,7 @@ class BuildFiles implements \JsonSerializable private $finder; private $extension_map; private $config; - private $files = []; + private $files = []; private $compiled = false; public function __construct( diff --git a/src/Builder/Bundler.php b/src/Builder/Bundler.php index 7c40495..a75cde1 100644 --- a/src/Builder/Bundler.php +++ b/src/Builder/Bundler.php @@ -40,7 +40,7 @@ public function bundle(BuildConfig $build_config): void $filesystem->dumpFile($config_file, json_encode($build_config, JSON_PRETTY_PRINT)); $new_build_config = true; - $extension_map = $build_config->getExtensionMap(); + $extension_map = $build_config->getExtensionMap(); } else { $extension_map = new ExtensionMap($json_data['mapping']); } @@ -68,7 +68,7 @@ public function bundle(BuildConfig $build_config): void $reader = new OutputReader($this->config->getReporter()); - $process->run(function ($type, $buffer) use ($reader) { + $process->run(function ($type, $buffer) use ($reader): void { if (Process::OUT !== $type) { return; } diff --git a/src/Builder/OutputReader.php b/src/Builder/OutputReader.php index a3668b5..99394cf 100644 --- a/src/Builder/OutputReader.php +++ b/src/Builder/OutputReader.php @@ -28,8 +28,8 @@ public function append(string $content): void // Now parse it line-by-line while (false !== ($i = strpos($this->buffer, "\n"))) { - $line = substr($this->buffer, 0, $i); - $this->buffer = substr($this->buffer, $i+1); + $line = substr($this->buffer, 0, $i); + $this->buffer = substr($this->buffer, $i + 1); $this->parseAndReport($line); } diff --git a/src/Cache/FileCacheInterface.php b/src/Cache/FileCacheInterface.php index 28d622d..6e6fef2 100644 --- a/src/Cache/FileCacheInterface.php +++ b/src/Cache/FileCacheInterface.php @@ -16,10 +16,10 @@ interface FileCacheInterface extends CacheInterface /** * Save the cache to disk. */ - public function save(); + public function save(): void; /** * Load the cache from disk. */ - public function load(); + public function load(): void; } diff --git a/src/Module.php b/src/Module.php index e3a5b5f..0c5d7b9 100644 --- a/src/Module.php +++ b/src/Module.php @@ -34,9 +34,9 @@ public function getName(): string */ public function getParentName(): string { - $dir_parts = explode('/', $this->path); + $dir_parts = explode('/', $this->path); $module_parts = explode('/', $this->name); - $parts = []; + $parts = []; for ($i = 0, $n = \count($dir_parts); $i < $n; $i++) { if ($dir_parts[$i] === $module_parts[0]) { diff --git a/src/Packer.php b/src/Packer.php index e558f38..50da46c 100644 --- a/src/Packer.php +++ b/src/Packer.php @@ -29,7 +29,7 @@ public static function pack(ConfigInterface $config): void $finder = new ImportFinder($config->getProjectRoot()); $build_config = new BuildConfig($config); - $plugin_api = new PluginApi($finder, $config, $cache, $build_config); + $plugin_api = new PluginApi($finder, $config, $cache, $build_config); (new PluginActivator($plugin_api))->ensurePluginsAreActivated(); $bundler = new Bundler($finder, $config); diff --git a/src/Report/ConsoleLoggingReporter.php b/src/Report/ConsoleLoggingReporter.php index 4d8b335..b7b9490 100644 --- a/src/Report/ConsoleLoggingReporter.php +++ b/src/Report/ConsoleLoggingReporter.php @@ -31,7 +31,7 @@ public function __construct( ) { $this->config = $config; $this->console_output = $console_output; - $this->size_helper = $size_helper; + $this->size_helper = $size_helper; } public function reportOutputFile(File $file): void @@ -77,7 +77,7 @@ public function reportFileContent(File $file, string $content): void private function makeRelativeToRoot(File $file): string { // make the output file relative to the output folder - $path = File::clean($file->path); + $path = File::clean($file->path); $output_dir = $this->config->getProjectRoot() . '/'; if (false !== strpos($path, $output_dir)) { diff --git a/src/Report/ConsoleReporter.php b/src/Report/ConsoleReporter.php index 395c99d..d632018 100644 --- a/src/Report/ConsoleReporter.php +++ b/src/Report/ConsoleReporter.php @@ -130,8 +130,8 @@ private function getFullDependencyList(): array return []; } - $files = array_merge(...array_values($this->dependencies)); - $names = array_values(array_unique(array_map(function (DependencyNodeInterface $dep) { + $files = array_merge(...array_values($this->dependencies)); + $names = array_values(array_unique(array_map(function (DependencyNodeInterface $dep) { return $this->makeRelativeToRoot($dep->getFile()); }, $files))); $reasons = array_combine($names, array_fill(0, count($names), [])); @@ -158,7 +158,7 @@ private function getFullDependencyList(): array private function makeRelativeToRoot(File $file): string { // make the output file relative to the output folder - $path = File::clean($file->path); + $path = File::clean($file->path); $output_dir = $this->config->getProjectRoot() . '/'; if (false !== strpos($path, $output_dir)) { diff --git a/test/Builder/AbstractBuildStepTest.php b/tests/Builder/AbstractBuildStepTest.php similarity index 100% rename from test/Builder/AbstractBuildStepTest.php rename to tests/Builder/AbstractBuildStepTest.php diff --git a/test/Builder/AbstractWriterTest.php b/tests/Builder/AbstractWriterTest.php similarity index 100% rename from test/Builder/AbstractWriterTest.php rename to tests/Builder/AbstractWriterTest.php diff --git a/test/Builder/AssetTest.php b/tests/Builder/AssetTest.php similarity index 100% rename from test/Builder/AssetTest.php rename to tests/Builder/AssetTest.php diff --git a/test/Builder/BuildConfigTest.php b/tests/Builder/BuildConfigTest.php similarity index 99% rename from test/Builder/BuildConfigTest.php rename to tests/Builder/BuildConfigTest.php index c0d15e8..fd22627 100644 --- a/test/Builder/BuildConfigTest.php +++ b/tests/Builder/BuildConfigTest.php @@ -16,7 +16,7 @@ class BuildConfigTest extends TestCase { private $config; - protected function setUp() + protected function setUp(): void { $this->config = $this->prophesize(ConfigInterface::class); @@ -434,7 +434,6 @@ public function testGetExtensionMap(): void 'long b' ); - $writer = $this->makeWriter('.js', 'out'); $build_config = new BuildConfig($this->config->reveal()); diff --git a/test/Builder/BuildFilesTest.php b/tests/Builder/BuildFilesTest.php similarity index 99% rename from test/Builder/BuildFilesTest.php rename to tests/Builder/BuildFilesTest.php index f3e4a1d..62a434c 100644 --- a/test/Builder/BuildFilesTest.php +++ b/tests/Builder/BuildFilesTest.php @@ -31,7 +31,7 @@ class BuildFilesTest extends TestCase */ private $build_files; - protected function setUp() + protected function setUp(): void { $this->finder = $this->prophesize(ImportFinderInterface::class); $this->extension_map = new ExtensionMap(['.js' => '.js']); diff --git a/test/Builder/BundlerTest.php b/tests/Builder/BundlerTest.php similarity index 97% rename from test/Builder/BundlerTest.php rename to tests/Builder/BundlerTest.php index 6218aa0..9d0d969 100644 --- a/test/Builder/BundlerTest.php +++ b/tests/Builder/BundlerTest.php @@ -48,7 +48,7 @@ public function testBundle(): void { try { // Fake node by using PHP and making the build script a php file. - $node = new Executable('php', ''); + $node = new Executable('php', ''); $reporter = $this->prophesize(ReporterInterface::class); $this->config->getOutputFolder()->willReturn('dist'); @@ -98,7 +98,7 @@ public function testBundleWithCache(): void { try { // Fake node by using PHP and making the build script a php file. - $node = new Executable('php', ''); + $node = new Executable('php', ''); $reporter = $this->prophesize(ReporterInterface::class); $this->config->getOutputFolder()->willReturn('dist'); @@ -156,7 +156,7 @@ public function testBundleWithNoFiles(): void ); // Fake node by using PHP and making the build script a php file. - $node = new Executable('php', ''); + $node = new Executable('php', ''); $reporter = $this->prophesize(ReporterInterface::class); $this->config->getOutputFolder()->willReturn('dist'); @@ -200,7 +200,7 @@ public function testBundleBuildError(): void try { // Fake node by using PHP and making the build script a php file. - $node = new Executable('php', ''); + $node = new Executable('php', ''); $reporter = $this->prophesize(ReporterInterface::class); $this->config->getOutputFolder()->willReturn('dist'); diff --git a/test/Builder/EntryPointTest.php b/tests/Builder/EntryPointTest.php similarity index 98% rename from test/Builder/EntryPointTest.php rename to tests/Builder/EntryPointTest.php index c93100e..0e36f32 100644 --- a/test/Builder/EntryPointTest.php +++ b/tests/Builder/EntryPointTest.php @@ -105,7 +105,7 @@ function (DependencyNodeInterface $dep) { ); } - public function testWithDifferentExtension() + public function testWithDifferentExtension(): void { $file = new File('app.ts'); $dep = new Dependency($file); diff --git a/test/Builder/ExtensionMapTest.php b/tests/Builder/ExtensionMapTest.php similarity index 100% rename from test/Builder/ExtensionMapTest.php rename to tests/Builder/ExtensionMapTest.php diff --git a/test/Builder/MockStep.php b/tests/Builder/MockStep.php similarity index 100% rename from test/Builder/MockStep.php rename to tests/Builder/MockStep.php diff --git a/test/Builder/MockWriter.php b/tests/Builder/MockWriter.php similarity index 100% rename from test/Builder/MockWriter.php rename to tests/Builder/MockWriter.php diff --git a/test/Builder/OutputReaderTest.php b/tests/Builder/OutputReaderTest.php similarity index 96% rename from test/Builder/OutputReaderTest.php rename to tests/Builder/OutputReaderTest.php index 3dd7f0c..17e36bd 100644 --- a/test/Builder/OutputReaderTest.php +++ b/tests/Builder/OutputReaderTest.php @@ -22,7 +22,7 @@ class OutputReaderTest extends TestCase */ private $output_reader; - protected function setUp() + protected function setUp(): void { $this->reporter = $this->prophesize(ReporterInterface::class); @@ -31,7 +31,7 @@ protected function setUp() ); } - public function testReading() + public function testReading(): void { $this->reporter->reportFileState(new File('a.js'), ReporterInterface::STATE_BUILT)->shouldBeCalled(); $this->reporter->reportFileState(new File('b.js'), ReporterInterface::STATE_BUILT)->shouldBeCalled(); diff --git a/test/Builder/Step/CleanCssBuildStepTest.php b/tests/Builder/Step/CleanCssBuildStepTest.php similarity index 90% rename from test/Builder/Step/CleanCssBuildStepTest.php rename to tests/Builder/Step/CleanCssBuildStepTest.php index 5644117..b19059f 100644 --- a/test/Builder/Step/CleanCssBuildStepTest.php +++ b/tests/Builder/Step/CleanCssBuildStepTest.php @@ -26,6 +26,6 @@ public function testGeneric(): void self::assertSame('.css', $step->acceptedExtension()); self::assertSame('.css', $step->resultingExtension()); self::assertSame(10, $step->buildPriority()); - self::assertContains('js/steps/cleancss.js', $step->getJsModule()); + self::assertStringContainsString('js/steps/cleancss.js', $step->getJsModule()); } } diff --git a/test/Builder/Step/CssFontRewriteStepTest.php b/tests/Builder/Step/CssFontRewriteStepTest.php similarity index 88% rename from test/Builder/Step/CssFontRewriteStepTest.php rename to tests/Builder/Step/CssFontRewriteStepTest.php index 9ca19e4..ff40419 100644 --- a/test/Builder/Step/CssFontRewriteStepTest.php +++ b/tests/Builder/Step/CssFontRewriteStepTest.php @@ -22,6 +22,6 @@ public function testGeneric(): void self::assertSame(AbstractBuildStep::FILE_READY, $step->resultingState()); self::assertSame('.css', $step->acceptedExtension()); self::assertSame('.css', $step->resultingExtension()); - self::assertContains('js/steps/css_rewrite.js', $step->getJsModule()); + self::assertStringContainsString('js/steps/css_rewrite.js', $step->getJsModule()); } } diff --git a/test/Builder/Step/IdentityBuildStepTest.php b/tests/Builder/Step/IdentityBuildStepTest.php similarity index 90% rename from test/Builder/Step/IdentityBuildStepTest.php rename to tests/Builder/Step/IdentityBuildStepTest.php index a789571..fa55de8 100644 --- a/test/Builder/Step/IdentityBuildStepTest.php +++ b/tests/Builder/Step/IdentityBuildStepTest.php @@ -25,6 +25,6 @@ public function testGeneric(): void self::assertSame(AbstractBuildStep::FILE_READY, $step->resultingState()); self::assertSame('.js', $step->acceptedExtension()); self::assertSame('.js', $step->resultingExtension()); - self::assertContains('js/steps/identity.js', $step->getJsModule()); + self::assertStringContainsString('js/steps/identity.js', $step->getJsModule()); } } diff --git a/test/Builder/Step/LessBuildStepTest.php b/tests/Builder/Step/LessBuildStepTest.php similarity index 89% rename from test/Builder/Step/LessBuildStepTest.php rename to tests/Builder/Step/LessBuildStepTest.php index 0908e7a..96679ea 100644 --- a/test/Builder/Step/LessBuildStepTest.php +++ b/tests/Builder/Step/LessBuildStepTest.php @@ -22,6 +22,6 @@ public function testGeneric(): void self::assertSame(AbstractBuildStep::FILE_READY, $step->resultingState()); self::assertSame('.less', $step->acceptedExtension()); self::assertSame('.css', $step->resultingExtension()); - self::assertContains('js/steps/less.js', $step->getJsModule()); + self::assertStringContainsString('js/steps/less.js', $step->getJsModule()); } } diff --git a/test/Builder/Step/ModuleBuildStepTest.php b/tests/Builder/Step/ModuleBuildStepTest.php similarity index 89% rename from test/Builder/Step/ModuleBuildStepTest.php rename to tests/Builder/Step/ModuleBuildStepTest.php index 72cd931..4b7ea50 100644 --- a/test/Builder/Step/ModuleBuildStepTest.php +++ b/tests/Builder/Step/ModuleBuildStepTest.php @@ -22,6 +22,6 @@ public function testGeneric(): void self::assertSame(AbstractBuildStep::FILE_READY, $step->resultingState()); self::assertSame('.js', $step->acceptedExtension()); self::assertSame('.js', $step->resultingExtension()); - self::assertContains('js/steps/module.js', $step->getJsModule()); + self::assertStringContainsString('js/steps/module.js', $step->getJsModule()); } } diff --git a/test/Builder/Step/TypescriptBuildStepTest.php b/tests/Builder/Step/TypescriptBuildStepTest.php similarity index 89% rename from test/Builder/Step/TypescriptBuildStepTest.php rename to tests/Builder/Step/TypescriptBuildStepTest.php index fcba10c..4b71bec 100644 --- a/test/Builder/Step/TypescriptBuildStepTest.php +++ b/tests/Builder/Step/TypescriptBuildStepTest.php @@ -22,6 +22,6 @@ public function testGeneric(): void self::assertSame(AbstractBuildStep::FILE_TRANSPILED, $step->resultingState()); self::assertSame('.ts', $step->acceptedExtension()); self::assertSame('.js', $step->resultingExtension()); - self::assertContains('js/steps/ts.js', $step->getJsModule()); + self::assertStringContainsString('js/steps/ts.js', $step->getJsModule()); } } diff --git a/test/Builder/Step/UglifyBuildStepTest.php b/tests/Builder/Step/UglifyBuildStepTest.php similarity index 90% rename from test/Builder/Step/UglifyBuildStepTest.php rename to tests/Builder/Step/UglifyBuildStepTest.php index ea96d86..6c233d0 100644 --- a/test/Builder/Step/UglifyBuildStepTest.php +++ b/tests/Builder/Step/UglifyBuildStepTest.php @@ -26,6 +26,6 @@ public function testGeneric(): void self::assertSame('.js', $step->acceptedExtension()); self::assertSame('.js', $step->resultingExtension()); self::assertSame(10, $step->buildPriority()); - self::assertContains('js/steps/uglify.js', $step->getJsModule()); + self::assertStringContainsString('js/steps/uglify.js', $step->getJsModule()); } } diff --git a/test/Builder/TreeWalkerTest.php b/tests/Builder/TreeWalkerTest.php similarity index 92% rename from test/Builder/TreeWalkerTest.php rename to tests/Builder/TreeWalkerTest.php index dfb050e..3318dae 100644 --- a/test/Builder/TreeWalkerTest.php +++ b/tests/Builder/TreeWalkerTest.php @@ -16,11 +16,11 @@ */ class TreeWalkerTest extends TestCase { - public function testWalk() + public function testWalk(): void { $seen = []; - $walker = new TreeWalker(function (DependencyNodeInterface $node) use (&$seen) { + $walker = new TreeWalker(function (DependencyNodeInterface $node) use (&$seen): void { $seen[] = $node; }); @@ -36,7 +36,7 @@ public function testWalk() self::assertSame([$root, $child, $grand_child], $seen); } - public function testWalkEarlyStop() + public function testWalkEarlyStop(): void { $seen = []; @@ -58,7 +58,7 @@ public function testWalkEarlyStop() self::assertSame([$root], $seen); } - public function testWalkSkipSubtree() + public function testWalkSkipSubtree(): void { $root = new RootFile(new File('foo')); $child = new RootFile(new File('foo')); diff --git a/test/Builder/Writer/BrotliFileWriterTest.php b/tests/Builder/Writer/BrotliFileWriterTest.php similarity index 83% rename from test/Builder/Writer/BrotliFileWriterTest.php rename to tests/Builder/Writer/BrotliFileWriterTest.php index 8363916..ac6b42b 100644 --- a/test/Builder/Writer/BrotliFileWriterTest.php +++ b/tests/Builder/Writer/BrotliFileWriterTest.php @@ -18,6 +18,6 @@ public function testGeneric(): void $step = new BrotliFileWriter(); self::assertSame('*', $step->acceptedExtension()); - self::assertContains('js/writers/brotli.js', $step->getJsModule()); + self::assertStringContainsString('js/writers/brotli.js', $step->getJsModule()); } } diff --git a/test/Builder/Writer/GenericFileWriterTest.php b/tests/Builder/Writer/GenericFileWriterTest.php similarity index 83% rename from test/Builder/Writer/GenericFileWriterTest.php rename to tests/Builder/Writer/GenericFileWriterTest.php index 3402733..f23f465 100644 --- a/test/Builder/Writer/GenericFileWriterTest.php +++ b/tests/Builder/Writer/GenericFileWriterTest.php @@ -18,6 +18,6 @@ public function testGeneric(): void $step = new GenericFileWriter(); self::assertSame('*', $step->acceptedExtension()); - self::assertContains('js/writers/generic.js', $step->getJsModule()); + self::assertStringContainsString('js/writers/generic.js', $step->getJsModule()); } } diff --git a/test/Builder/Writer/GzipFileWriterTest.php b/tests/Builder/Writer/GzipFileWriterTest.php similarity index 83% rename from test/Builder/Writer/GzipFileWriterTest.php rename to tests/Builder/Writer/GzipFileWriterTest.php index 9e79725..e4393a3 100644 --- a/test/Builder/Writer/GzipFileWriterTest.php +++ b/tests/Builder/Writer/GzipFileWriterTest.php @@ -18,6 +18,6 @@ public function testGeneric(): void $step = new GzipFileWriter(); self::assertSame('*', $step->acceptedExtension()); - self::assertContains('js/writers/gz.js', $step->getJsModule()); + self::assertStringContainsString('js/writers/gz.js', $step->getJsModule()); } } diff --git a/test/Builder/fixtures/fez.js b/tests/Builder/fixtures/fez.js similarity index 100% rename from test/Builder/fixtures/fez.js rename to tests/Builder/fixtures/fez.js diff --git a/test/Builder/fixtures/foo.js b/tests/Builder/fixtures/foo.js similarity index 100% rename from test/Builder/fixtures/foo.js rename to tests/Builder/fixtures/foo.js diff --git a/test/Builder/fixtures/sub/bar.js b/tests/Builder/fixtures/sub/bar.js similarity index 100% rename from test/Builder/fixtures/sub/bar.js rename to tests/Builder/fixtures/sub/bar.js diff --git a/test/Builder/mock_broken_builder.php b/tests/Builder/mock_broken_builder.php similarity index 100% rename from test/Builder/mock_broken_builder.php rename to tests/Builder/mock_broken_builder.php diff --git a/test/Builder/mock_builder.php b/tests/Builder/mock_builder.php similarity index 100% rename from test/Builder/mock_builder.php rename to tests/Builder/mock_builder.php diff --git a/test/Builder/stdin-files.expected.json b/tests/Builder/stdin-files.expected.json similarity index 100% rename from test/Builder/stdin-files.expected.json rename to tests/Builder/stdin-files.expected.json diff --git a/test/Builder/stdin.expected.json b/tests/Builder/stdin.expected.json similarity index 100% rename from test/Builder/stdin.expected.json rename to tests/Builder/stdin.expected.json diff --git a/test/Builder/var-saved/52/689af_dist.require.js.sources b/tests/Builder/var-saved/52/689af_dist.require.js.sources similarity index 100% rename from test/Builder/var-saved/52/689af_dist.require.js.sources rename to tests/Builder/var-saved/52/689af_dist.require.js.sources diff --git a/test/Builder/var-saved/76/69db8_out.fixtures.foo.js.sources b/tests/Builder/var-saved/76/69db8_out.fixtures.foo.js.sources similarity index 100% rename from test/Builder/var-saved/76/69db8_out.fixtures.foo.js.sources rename to tests/Builder/var-saved/76/69db8_out.fixtures.foo.js.sources diff --git a/test/Builder/var-saved/b5/f0ef8_out.require.js.sources b/tests/Builder/var-saved/b5/f0ef8_out.require.js.sources similarity index 100% rename from test/Builder/var-saved/b5/f0ef8_out.require.js.sources rename to tests/Builder/var-saved/b5/f0ef8_out.require.js.sources diff --git a/test/Builder/var-saved/build_config.json b/tests/Builder/var-saved/build_config.json similarity index 81% rename from test/Builder/var-saved/build_config.json rename to tests/Builder/var-saved/build_config.json index 6ca6ba4..e4512db 100644 --- a/test/Builder/var-saved/build_config.json +++ b/tests/Builder/var-saved/build_config.json @@ -1,5 +1,5 @@ { - "checksum": "02c77786d30f5fe3667d624b212757bc", + "checksum": "d5d5e0eb56c03942794d09e8303acc93", "mapping": { ".js": ".js" }, diff --git a/test/Cache/CacheTest.php b/tests/Cache/CacheTest.php similarity index 75% rename from test/Cache/CacheTest.php rename to tests/Cache/CacheTest.php index 61583fc..26b6766 100644 --- a/test/Cache/CacheTest.php +++ b/tests/Cache/CacheTest.php @@ -6,6 +6,7 @@ namespace Hostnet\Component\Resolver\Cache; +use Hostnet\Component\Resolver\Cache\Exception\InvalidArgumentException; use Hostnet\Component\Resolver\File; use PHPUnit\Framework\TestCase; @@ -14,7 +15,7 @@ */ class CacheTest extends TestCase { - public function testGeneric() + public function testGeneric(): void { $cache = new Cache(); @@ -41,7 +42,7 @@ public function testGeneric() self::assertFalse($cache->has('barbaz')); } - public function testPersistence() + public function testPersistence(): void { $cache1 = new Cache(__DIR__ . '/deps'); $cache1->load(); @@ -61,43 +62,39 @@ public function testPersistence() self::assertSame('phpunit', $cache2->get('barbaz')); } - public function testCreateFileCacheKey() + public function testCreateFileCacheKey(): void { self::assertSame('c3/0102c_foo.js', Cache::createFileCacheKey(new File('foo.js'))); } - /** - * @expectedException \Hostnet\Component\Resolver\Cache\Exception\InvalidArgumentException - */ - public function testDeleteNoneExistingKey() + public function testDeleteNoneExistingKey(): void { + $this->expectException(InvalidArgumentException::class); + $cache = new Cache(); $cache->delete('foobar'); } - /** - * @expectedException \BadMethodCallException - */ - public function testGetMultiple() + public function testGetMultiple(): void { + $this->expectException(\BadMethodCallException::class); + $cache = new Cache(); $cache->getMultiple([]); } - /** - * @expectedException \BadMethodCallException - */ - public function testSetMultiple() + public function testSetMultiple(): void { + $this->expectException(\BadMethodCallException::class); + $cache = new Cache(); $cache->setMultiple([]); } - /** - * @expectedException \BadMethodCallException - */ - public function testDeleteMultiple() + public function testDeleteMultiple(): void { + $this->expectException(\BadMethodCallException::class); + $cache = new Cache(); $cache->deleteMultiple([]); } diff --git a/test/Cache/CachedImportCollectorTest.php b/tests/Cache/CachedImportCollectorTest.php similarity index 91% rename from test/Cache/CachedImportCollectorTest.php rename to tests/Cache/CachedImportCollectorTest.php index 04a28cb..426eaae 100644 --- a/test/Cache/CachedImportCollectorTest.php +++ b/tests/Cache/CachedImportCollectorTest.php @@ -24,7 +24,7 @@ class CachedImportCollectorTest extends TestCase */ private $cached_import_collector; - protected function setUp() + protected function setUp(): void { $this->inner = $this->prophesize(ImportCollectorInterface::class); $this->cache = new Cache(); @@ -35,7 +35,7 @@ protected function setUp() ); } - public function testSupports() + public function testSupports(): void { $file = new File('foo.js'); @@ -44,7 +44,7 @@ public function testSupports() self::assertTrue($this->cached_import_collector->supports($file)); } - public function testCollectNoCache() + public function testCollectNoCache(): void { $file = new File(basename(__FILE__)); $imports = new ImportCollection(); @@ -54,7 +54,7 @@ public function testCollectNoCache() $this->cached_import_collector->collect(__DIR__, $file, $imports); } - public function testCollectWithCache() + public function testCollectWithCache(): void { $file = new File(basename(__FILE__)); $imports = new ImportCollection(); diff --git a/test/Config/SimpleConfigTest.php b/tests/Config/SimpleConfigTest.php similarity index 99% rename from test/Config/SimpleConfigTest.php rename to tests/Config/SimpleConfigTest.php index a507728..42c716c 100644 --- a/test/Config/SimpleConfigTest.php +++ b/tests/Config/SimpleConfigTest.php @@ -21,7 +21,7 @@ */ class SimpleConfigTest extends TestCase { - public function testGeneric() + public function testGeneric(): void { $plugins = [$this->prophesize(PluginInterface::class)->reveal()]; $nodejs = new Executable('a', 'b'); diff --git a/test/FileTest.php b/tests/FileTest.php similarity index 98% rename from test/FileTest.php rename to tests/FileTest.php index 0c26e91..baca3fa 100644 --- a/test/FileTest.php +++ b/tests/FileTest.php @@ -13,7 +13,7 @@ */ class FileTest extends TestCase { - public function testGeneric() + public function testGeneric(): void { $file = new File(__FILE__); diff --git a/test/Import/BuiltIn/JsImportCollectorTest.php b/tests/Import/BuiltIn/JsImportCollectorTest.php similarity index 92% rename from test/Import/BuiltIn/JsImportCollectorTest.php rename to tests/Import/BuiltIn/JsImportCollectorTest.php index a8c1aa8..7d57382 100644 --- a/test/Import/BuiltIn/JsImportCollectorTest.php +++ b/tests/Import/BuiltIn/JsImportCollectorTest.php @@ -26,7 +26,7 @@ class JsImportCollectorTest extends TestCase */ private $js_import_collector; - protected function setUp() + protected function setUp(): void { $config = $this->prophesize(ConfigInterface::class); $config->getProjectRoot()->willReturn(__DIR__ . '/../../fixtures'); @@ -41,12 +41,12 @@ protected function setUp() /** * @dataProvider supportsProvider */ - public function testSupports($expected, File $file) + public function testSupports(bool $expected, File $file): void { self::assertEquals($expected, $this->js_import_collector->supports($file)); } - public function supportsProvider() + public function supportsProvider(): array { return [ [false, new File('foo')], @@ -57,7 +57,7 @@ public function supportsProvider() ]; } - public function testCollect() + public function testCollect(): void { $imports = new ImportCollection(); $file = new File('resolver/js/require-syntax/main.js'); @@ -80,7 +80,7 @@ public function testCollect() self::assertEquals([], $imports->getResources()); } - public function testCollectBadRequires() + public function testCollectBadRequires(): void { $imports = new ImportCollection(); $file = new File('resolver/js/require-syntax/red_haring.js'); @@ -91,7 +91,7 @@ public function testCollectBadRequires() self::assertEquals([], $imports->getResources()); } - public function testCollectRequireException() + public function testCollectRequireException(): void { $resolver = $this->prophesize(FileResolverInterface::class); $imports = new ImportCollection(); diff --git a/test/Import/BuiltIn/LessImportCollectorTest.php b/tests/Import/BuiltIn/LessImportCollectorTest.php similarity index 92% rename from test/Import/BuiltIn/LessImportCollectorTest.php rename to tests/Import/BuiltIn/LessImportCollectorTest.php index 444f8ab..af85216 100644 --- a/test/Import/BuiltIn/LessImportCollectorTest.php +++ b/tests/Import/BuiltIn/LessImportCollectorTest.php @@ -21,7 +21,7 @@ class LessImportCollectorTest extends TestCase */ private $less_import_collector; - protected function setUp() + protected function setUp(): void { $this->less_import_collector = new LessImportCollector(); } @@ -29,12 +29,12 @@ protected function setUp() /** * @dataProvider supportsProvider */ - public function testSupports($expected, File $file) + public function testSupports(bool $expected, File $file): void { self::assertEquals($expected, $this->less_import_collector->supports($file)); } - public function supportsProvider() + public function supportsProvider(): array { return [ [false, new File('foo')], @@ -45,7 +45,7 @@ public function supportsProvider() ]; } - public function testCollect() + public function testCollect(): void { $imports = new ImportCollection(); $file = new File('resolver/less/import-syntax/main.less'); diff --git a/test/Import/BuiltIn/TsImportCollectorTest.php b/tests/Import/BuiltIn/TsImportCollectorTest.php similarity index 94% rename from test/Import/BuiltIn/TsImportCollectorTest.php rename to tests/Import/BuiltIn/TsImportCollectorTest.php index fecfe46..7590182 100644 --- a/test/Import/BuiltIn/TsImportCollectorTest.php +++ b/tests/Import/BuiltIn/TsImportCollectorTest.php @@ -26,7 +26,7 @@ class TsImportCollectorTest extends TestCase */ private $ts_import_collector; - protected function setUp() + protected function setUp(): void { $config = $this->prophesize(ConfigInterface::class); $config->getProjectRoot()->willReturn(__DIR__ . '/../../fixtures'); @@ -42,12 +42,12 @@ protected function setUp() /** * @dataProvider supportsProvider */ - public function testSupports($expected, File $file) + public function testSupports(bool $expected, File $file): void { self::assertEquals($expected, $this->ts_import_collector->supports($file)); } - public function supportsProvider() + public function supportsProvider(): array { return [ [false, new File('foo')], @@ -58,7 +58,7 @@ public function supportsProvider() ]; } - public function testCollect() + public function testCollect(): void { $imports = new ImportCollection(); $file = new File('resolver/ts/import-syntax/main.ts'); @@ -90,7 +90,7 @@ public function testCollect() self::assertEquals([], $imports->getResources()); } - public function testCollectRequireException() + public function testCollectRequireException(): void { $resolver = $this->prophesize(FileResolverInterface::class); $imports = new ImportCollection(); diff --git a/test/Import/DependencyTest.php b/tests/Import/DependencyTest.php similarity index 94% rename from test/Import/DependencyTest.php rename to tests/Import/DependencyTest.php index eede416..32d5497 100644 --- a/test/Import/DependencyTest.php +++ b/tests/Import/DependencyTest.php @@ -14,7 +14,7 @@ */ class DependencyTest extends TestCase { - public function testGeneric() + public function testGeneric(): void { $file = new File('foo.js'); $root = new Dependency($file, true, true); diff --git a/test/Import/ImportCollectionTest.php b/tests/Import/ImportCollectionTest.php similarity index 96% rename from test/Import/ImportCollectionTest.php rename to tests/Import/ImportCollectionTest.php index 14b1908..c31bb3e 100644 --- a/test/Import/ImportCollectionTest.php +++ b/tests/Import/ImportCollectionTest.php @@ -14,7 +14,7 @@ */ class ImportCollectionTest extends TestCase { - public function testGeneric() + public function testGeneric(): void { $collection = new ImportCollection(); diff --git a/test/Import/ImportFinderTest.php b/tests/Import/ImportFinderTest.php similarity index 94% rename from test/Import/ImportFinderTest.php rename to tests/Import/ImportFinderTest.php index ba4162c..ffcf317 100644 --- a/test/Import/ImportFinderTest.php +++ b/tests/Import/ImportFinderTest.php @@ -19,12 +19,12 @@ class ImportFinderTest extends TestCase */ private $import_finder; - protected function setUp() + protected function setUp(): void { $this->import_finder = new ImportFinder(__DIR__); } - public function testAll() + public function testAll(): void { $file = new File('foo.js'); diff --git a/test/Import/ImportTest.php b/tests/Import/ImportTest.php similarity index 93% rename from test/Import/ImportTest.php rename to tests/Import/ImportTest.php index b228967..50fd8c0 100644 --- a/test/Import/ImportTest.php +++ b/tests/Import/ImportTest.php @@ -14,7 +14,7 @@ */ class ImportTest extends TestCase { - public function testGeneric() + public function testGeneric(): void { $file = new File('foo.js'); diff --git a/test/Import/Nodejs/ExecutableTest.php b/tests/Import/Nodejs/ExecutableTest.php similarity index 92% rename from test/Import/Nodejs/ExecutableTest.php rename to tests/Import/Nodejs/ExecutableTest.php index 42e82c2..59173d7 100644 --- a/test/Import/Nodejs/ExecutableTest.php +++ b/tests/Import/Nodejs/ExecutableTest.php @@ -13,7 +13,7 @@ */ class ExecutableTest extends TestCase { - public function testGeneric() + public function testGeneric(): void { $executable = new Executable('foo/node', 'foo/node_modules'); diff --git a/test/Import/Nodejs/FileResolverTest.php b/tests/Import/Nodejs/FileResolverTest.php similarity index 88% rename from test/Import/Nodejs/FileResolverTest.php rename to tests/Import/Nodejs/FileResolverTest.php index b6cc956..b2b7083 100644 --- a/test/Import/Nodejs/FileResolverTest.php +++ b/tests/Import/Nodejs/FileResolverTest.php @@ -9,6 +9,7 @@ use Hostnet\Component\Resolver\Config\ConfigInterface; use Hostnet\Component\Resolver\File; use Hostnet\Component\Resolver\Import\FileResolverInterface; +use Hostnet\Component\Resolver\Import\Nodejs\Exception\FileNotFoundException; use Hostnet\Component\Resolver\Module; use PHPUnit\Framework\TestCase; @@ -22,7 +23,7 @@ class FileResolverTest extends TestCase */ private $file_resolver; - protected function setUp() + protected function setUp(): void { $config = $this->prophesize(ConfigInterface::class); $config->getProjectRoot()->willReturn(__DIR__ . '/../../fixtures'); @@ -31,7 +32,7 @@ protected function setUp() $this->file_resolver = new FileResolver($config->reveal(), ['.js', '.json', '.node']); } - public function testAsRequireFile() + public function testAsRequireFile(): void { $parent = new File('node_modules/bar/baz.js'); $import = $this->file_resolver->asRequire('./foo/hom', $parent); @@ -41,7 +42,7 @@ public function testAsRequireFile() self::assertSame('node_modules/bar/foo/hom.js', $import->getImportedFile()->getName()); } - public function testAsRequireFileFromModule() + public function testAsRequireFileFromModule(): void { $parent = new Module('bar/baz', 'node_modules/bar/baz.js'); $import = $this->file_resolver->asRequire('./foo/hom', $parent); @@ -51,7 +52,7 @@ public function testAsRequireFileFromModule() self::assertSame('bar/foo/hom', $import->getImportedFile()->getName()); } - public function testAsRequireAbsoluteFile() + public function testAsRequireAbsoluteFile(): void { $parent = new File('node_modules/bar/baz.js'); $path = File::clean(__DIR__ . '/../../fixtures/node_modules/bar/foo/hom'); @@ -63,7 +64,7 @@ public function testAsRequireAbsoluteFile() self::assertSame($path . '.js', $import->getImportedFile()->getName()); } - public function testAsRequireAbsoluteFileFromModule() + public function testAsRequireAbsoluteFileFromModule(): void { $parent = new Module('bar/baz', 'node_modules/bar/baz.js'); $path = File::clean(__DIR__ . '/../../fixtures/node_modules/bar/foo/hom'); @@ -75,7 +76,7 @@ public function testAsRequireAbsoluteFileFromModule() self::assertSame($path . '.js', $import->getImportedFile()->getName()); } - public function testAsRequireAbsoluteDir() + public function testAsRequireAbsoluteDir(): void { $parent = new File('node_modules/bar/baz.js'); $path = File::clean(__DIR__ . '/../../fixtures/node_modules/bar/foo/bar'); @@ -87,7 +88,7 @@ public function testAsRequireAbsoluteDir() self::assertSame($path . '/index.js', $import->getImportedFile()->getName()); } - public function testAsRequireAbsoluteDirFromModule() + public function testAsRequireAbsoluteDirFromModule(): void { $parent = new Module('bar/baz', 'node_modules/bar/baz.js'); $path = File::clean(__DIR__ . '/../../fixtures/node_modules/bar/foo/bar'); @@ -99,7 +100,7 @@ public function testAsRequireAbsoluteDirFromModule() self::assertSame($path . '/index.js', $import->getImportedFile()->getName()); } - public function testAsRequireAsDir() + public function testAsRequireAsDir(): void { $parent = new File('node_modules/bar/baz.js'); $import = $this->file_resolver->asRequire('./foo/bar', $parent); @@ -109,7 +110,7 @@ public function testAsRequireAsDir() self::assertSame('node_modules/bar/foo/bar/index.js', $import->getImportedFile()->getName()); } - public function testAsRequireAsDirFromModule() + public function testAsRequireAsDirFromModule(): void { $parent = new Module('bar/baz', 'node_modules/bar/baz.js'); $import = $this->file_resolver->asRequire('./foo/bar', $parent); @@ -119,7 +120,7 @@ public function testAsRequireAsDirFromModule() self::assertSame('bar/foo/bar', $import->getImportedFile()->getName()); } - public function testAsRequireModule() + public function testAsRequireModule(): void { $parent = new File('node_modules/bar/baz.js'); $import = $this->file_resolver->asRequire('jquery', $parent); @@ -129,7 +130,7 @@ public function testAsRequireModule() self::assertSame('jquery', $import->getImportedFile()->getName()); } - public function testAsRequireModuleWithDir() + public function testAsRequireModuleWithDir(): void { $parent = new File('node_modules/bar/baz.js'); $import = $this->file_resolver->asRequire('module_package_dir', $parent); @@ -139,7 +140,7 @@ public function testAsRequireModuleWithDir() self::assertSame('module_package_dir', $import->getImportedFile()->getName()); } - public function testAsRequireModuleFromOtherPath() + public function testAsRequireModuleFromOtherPath(): void { $parent = new File('node_modules/bar/baz.js'); $import = $this->file_resolver->asRequire('uikit', $parent); @@ -149,7 +150,7 @@ public function testAsRequireModuleFromOtherPath() self::assertSame('uikit', $import->getImportedFile()->getName()); } - public function testAsRequireModuleRelativeFromDifferentPath() + public function testAsRequireModuleRelativeFromDifferentPath(): void { $parent = new Module('module_package', 'node_modules/module_package/main.js'); $import = $this->file_resolver->asRequire('./subpackage/main', $parent); @@ -159,11 +160,9 @@ public function testAsRequireModuleRelativeFromDifferentPath() self::assertSame('module_package/subpackage/main', $import->getImportedFile()->getName()); } - /** - * @expectedException \Hostnet\Component\Resolver\Import\Nodejs\Exception\FileNotFoundException - */ - public function testAsRequireUnknown() + public function testAsRequireUnknown(): void { + $this->expectException(FileNotFoundException::class); $this->file_resolver->asRequire('foobar', new File('node_modules/bar/baz.js')); } } diff --git a/test/Import/RootFileTest.php b/tests/Import/RootFileTest.php similarity index 94% rename from test/Import/RootFileTest.php rename to tests/Import/RootFileTest.php index c76e818..613221d 100644 --- a/test/Import/RootFileTest.php +++ b/tests/Import/RootFileTest.php @@ -14,7 +14,7 @@ */ class RootFileTest extends TestCase { - public function testGeneric() + public function testGeneric(): void { $file = new File('foo.js'); $root = new RootFile($file); diff --git a/test/ModuleTest.php b/tests/ModuleTest.php similarity index 97% rename from test/ModuleTest.php rename to tests/ModuleTest.php index 9e93639..0bd0952 100644 --- a/test/ModuleTest.php +++ b/tests/ModuleTest.php @@ -13,7 +13,7 @@ */ class ModuleTest extends TestCase { - public function testGeneric() + public function testGeneric(): void { $file = new Module('foo/bar', 'node_modules/foo/bar/index.js'); diff --git a/test/Plugin/BrotliPluginTest.php b/tests/Plugin/BrotliPluginTest.php similarity index 93% rename from test/Plugin/BrotliPluginTest.php rename to tests/Plugin/BrotliPluginTest.php index 04a5eae..53c7b67 100644 --- a/test/Plugin/BrotliPluginTest.php +++ b/tests/Plugin/BrotliPluginTest.php @@ -15,7 +15,7 @@ */ class BrotliPluginTest extends TestCase { - public function testActivate() + public function testActivate(): void { $brotli_plugin = new BrotliPlugin(); diff --git a/test/Plugin/CorePluginTest.php b/tests/Plugin/CorePluginTest.php similarity index 96% rename from test/Plugin/CorePluginTest.php rename to tests/Plugin/CorePluginTest.php index ee4fbfb..484ac0f 100644 --- a/test/Plugin/CorePluginTest.php +++ b/tests/Plugin/CorePluginTest.php @@ -22,7 +22,7 @@ */ class CorePluginTest extends TestCase { - public function testActivate() + public function testActivate(): void { $cache = $this->prophesize(CacheInterface::class); $config = $this->prophesize(ConfigInterface::class); @@ -40,7 +40,7 @@ public function testActivate() $core_plugin->activate($plugin_api->reveal()); } - public function testActivateProd() + public function testActivateProd(): void { $cache = $this->prophesize(CacheInterface::class); $config = $this->prophesize(ConfigInterface::class); diff --git a/test/Plugin/CssFontRewitePluginTest.php b/tests/Plugin/CssFontRewritePluginTest.php similarity index 90% rename from test/Plugin/CssFontRewitePluginTest.php rename to tests/Plugin/CssFontRewritePluginTest.php index 5d78e86..f7eabdd 100644 --- a/test/Plugin/CssFontRewitePluginTest.php +++ b/tests/Plugin/CssFontRewritePluginTest.php @@ -13,11 +13,11 @@ use Prophecy\Argument; /** - * @covers \Hostnet\Component\Resolver\Plugin\CssFontRewitePlugin + * @covers \Hostnet\Component\Resolver\Plugin\CssFontRewritePlugin */ class CssFontRewritePluginTest extends TestCase { - public function testActivate() + public function testActivate(): void { $css_font_rewite_plugin = new CssFontRewritePlugin(); diff --git a/test/Plugin/GzipPluginTest.php b/tests/Plugin/GzipPluginTest.php similarity index 93% rename from test/Plugin/GzipPluginTest.php rename to tests/Plugin/GzipPluginTest.php index 7a37d99..16afc2f 100644 --- a/test/Plugin/GzipPluginTest.php +++ b/tests/Plugin/GzipPluginTest.php @@ -15,7 +15,7 @@ */ class GzipPluginTest extends TestCase { - public function testActivate() + public function testActivate(): void { $gzip_plugin = new GzipPlugin(); diff --git a/test/Plugin/LessPluginTest.php b/tests/Plugin/LessPluginTest.php similarity index 95% rename from test/Plugin/LessPluginTest.php rename to tests/Plugin/LessPluginTest.php index d219703..7da3d92 100644 --- a/test/Plugin/LessPluginTest.php +++ b/tests/Plugin/LessPluginTest.php @@ -19,7 +19,7 @@ */ class LessPluginTest extends TestCase { - public function testActivate() + public function testActivate(): void { $cache = $this->prophesize(CacheInterface::class); $config = $this->prophesize(ConfigInterface::class); @@ -35,7 +35,7 @@ public function testActivate() $less_plugin->activate($plugin_api->reveal()); } - public function testActivateProd() + public function testActivateProd(): void { $cache = $this->prophesize(CacheInterface::class); $config = $this->prophesize(ConfigInterface::class); diff --git a/test/Plugin/MinifyPluginTest.php b/tests/Plugin/MinifyPluginTest.php similarity index 94% rename from test/Plugin/MinifyPluginTest.php rename to tests/Plugin/MinifyPluginTest.php index 6d86ae7..4988444 100644 --- a/test/Plugin/MinifyPluginTest.php +++ b/tests/Plugin/MinifyPluginTest.php @@ -16,7 +16,7 @@ */ class MinifyPluginTest extends TestCase { - public function testActivate() + public function testActivate(): void { $minify_plugin = new MinifyPlugin(); diff --git a/test/Plugin/PluginActivatorTest.php b/tests/Plugin/PluginActivatorTest.php similarity index 93% rename from test/Plugin/PluginActivatorTest.php rename to tests/Plugin/PluginActivatorTest.php index c0d68f1..855ad61 100644 --- a/test/Plugin/PluginActivatorTest.php +++ b/tests/Plugin/PluginActivatorTest.php @@ -14,7 +14,7 @@ */ class PluginActivatorTest extends TestCase { - public function testEnsurePluginsAreActivated() + public function testEnsurePluginsAreActivated(): void { $plugin = $this->prophesize(PluginInterface::class); diff --git a/test/Plugin/PluginApiTest.php b/tests/Plugin/PluginApiTest.php similarity index 90% rename from test/Plugin/PluginApiTest.php rename to tests/Plugin/PluginApiTest.php index 98c693d..b1df038 100644 --- a/test/Plugin/PluginApiTest.php +++ b/tests/Plugin/PluginApiTest.php @@ -31,7 +31,7 @@ class PluginApiTest extends TestCase */ private $plugin_api; - protected function setUp() + protected function setUp(): void { $this->finder = $this->prophesize(MutableImportFinderInterface::class); $this->config = $this->prophesize(ConfigInterface::class); @@ -46,14 +46,14 @@ protected function setUp() ); } - public function testGetNodeJsExecutable() + public function testGetNodeJsExecutable(): void { $executable = new Executable('node', 'node_modules'); $this->config->getNodeJsExecutable()->willReturn($executable); self::assertSame($executable, $this->plugin_api->getNodeJsExecutable()); } - public function testAddBuildStep() + public function testAddBuildStep(): void { $build_step = $this->prophesize(AbstractBuildStep::class)->reveal(); $this->build_config->registerStep($build_step)->shouldBeCalled(); @@ -61,7 +61,7 @@ public function testAddBuildStep() $this->plugin_api->addBuildStep($build_step); } - public function testAddWriter() + public function testAddWriter(): void { $writer = $this->prophesize(AbstractWriter::class)->reveal(); $this->build_config->registerWriter($writer)->shouldBeCalled(); @@ -69,14 +69,14 @@ public function testAddWriter() $this->plugin_api->addWriter($writer); } - public function testAddCollector() + public function testAddCollector(): void { $collector = $this->prophesize(ImportCollectorInterface::class)->reveal(); $this->finder->addCollector($collector)->shouldBeCalled(); $this->plugin_api->addCollector($collector); } - public function testGetters() + public function testGetters(): void { self::assertSame($this->config->reveal(), $this->plugin_api->getConfig()); self::assertSame($this->cache->reveal(), $this->plugin_api->getCache()); diff --git a/test/Plugin/TsPluginTest.php b/tests/Plugin/TsPluginTest.php similarity index 95% rename from test/Plugin/TsPluginTest.php rename to tests/Plugin/TsPluginTest.php index 658e18a..731be04 100644 --- a/test/Plugin/TsPluginTest.php +++ b/tests/Plugin/TsPluginTest.php @@ -19,7 +19,7 @@ */ class TsPluginTest extends TestCase { - public function testActivate() + public function testActivate(): void { $cache = $this->prophesize(CacheInterface::class); $config = $this->prophesize(ConfigInterface::class); @@ -35,7 +35,7 @@ public function testActivate() $ts_plugin->activate($plugin_api->reveal()); } - public function testActivateProd() + public function testActivateProd(): void { $cache = $this->prophesize(CacheInterface::class); $config = $this->prophesize(ConfigInterface::class); diff --git a/test/Report/ConsoleLoggingReporterTest.php b/tests/Report/ConsoleLoggingReporterTest.php similarity index 98% rename from test/Report/ConsoleLoggingReporterTest.php rename to tests/Report/ConsoleLoggingReporterTest.php index 148d800..29ca26c 100644 --- a/test/Report/ConsoleLoggingReporterTest.php +++ b/tests/Report/ConsoleLoggingReporterTest.php @@ -19,7 +19,7 @@ */ class ConsoleLoggingReporterTest extends TestCase { - public function testGeneric() + public function testGeneric(): void { $config = $this->prophesize(ConfigInterface::class); $helper = $this->prophesize(FileSizeHelperInterface::class); diff --git a/test/Report/ConsoleReporterTest.php b/tests/Report/ConsoleReporterTest.php similarity index 96% rename from test/Report/ConsoleReporterTest.php rename to tests/Report/ConsoleReporterTest.php index 380dbb8..4fcee9e 100644 --- a/test/Report/ConsoleReporterTest.php +++ b/tests/Report/ConsoleReporterTest.php @@ -27,7 +27,7 @@ class ConsoleReporterTest extends TestCase */ private $console_reporter; - protected function setUp() + protected function setUp(): void { $this->config = $this->prophesize(ConfigInterface::class); $this->helper = $this->prophesize(FileSizeHelperInterface::class); @@ -35,7 +35,7 @@ protected function setUp() $this->console_reporter = new ConsoleReporter($this->config->reveal(), $this->helper->reveal(), true); } - public function testPrintReportEmpty() + public function testPrintReportEmpty(): void { $output = new BufferedOutput(); $this->console_reporter->printReport($output); @@ -43,7 +43,7 @@ public function testPrintReportEmpty() self::assertStringEqualsFile(__DIR__ . '/report.empty.txt', str_replace("\r\n", "\n", $output->fetch())); } - public function testPrintReport() + public function testPrintReport(): void { $this->config->getProjectRoot()->willReturn(__DIR__); diff --git a/test/Report/Helper/50b.txt b/tests/Report/Helper/50b.txt similarity index 100% rename from test/Report/Helper/50b.txt rename to tests/Report/Helper/50b.txt diff --git a/test/Report/Helper/FileSizeHelperTest.php b/tests/Report/Helper/FileSizeHelperTest.php similarity index 91% rename from test/Report/Helper/FileSizeHelperTest.php rename to tests/Report/Helper/FileSizeHelperTest.php index 038b09f..415b866 100644 --- a/test/Report/Helper/FileSizeHelperTest.php +++ b/tests/Report/Helper/FileSizeHelperTest.php @@ -18,7 +18,7 @@ class FileSizeHelperTest extends TestCase */ private $file_size_helper; - protected function setUp() + protected function setUp(): void { $this->file_size_helper = new FileSizeHelper(); } @@ -31,7 +31,7 @@ public function testSize(string $expected, int $size): void self::assertSame($expected, $this->file_size_helper->format($size)); } - public function sizeProvider() + public function sizeProvider(): array { return [ ['N/A', -1], @@ -49,11 +49,9 @@ public function sizeProvider() ]; } - /** - * @expectedException \LogicException - */ public function testSizeMax(): void { + $this->expectException(\LogicException::class); $this->file_size_helper->format(1099511627776); } diff --git a/test/Report/Helper/empty.txt b/tests/Report/Helper/empty.txt similarity index 100% rename from test/Report/Helper/empty.txt rename to tests/Report/Helper/empty.txt diff --git a/test/Report/NullReporterTest.php b/tests/Report/NullReporterTest.php similarity index 94% rename from test/Report/NullReporterTest.php rename to tests/Report/NullReporterTest.php index 163272f..b3f0676 100644 --- a/test/Report/NullReporterTest.php +++ b/tests/Report/NullReporterTest.php @@ -14,7 +14,7 @@ */ class NullReporterTest extends TestCase { - public function testGeneric() + public function testGeneric(): void { $null_reporter = new NullReporter(); diff --git a/test/Report/fixtures/a.js b/tests/Report/fixtures/a.js similarity index 100% rename from test/Report/fixtures/a.js rename to tests/Report/fixtures/a.js diff --git a/test/Report/fixtures/b.js b/tests/Report/fixtures/b.js similarity index 100% rename from test/Report/fixtures/b.js rename to tests/Report/fixtures/b.js diff --git a/test/Report/fixtures/c.js b/tests/Report/fixtures/c.js similarity index 100% rename from test/Report/fixtures/c.js rename to tests/Report/fixtures/c.js diff --git a/test/Report/fixtures/d.js b/tests/Report/fixtures/d.js similarity index 100% rename from test/Report/fixtures/d.js rename to tests/Report/fixtures/d.js diff --git a/test/Report/log.txt b/tests/Report/log.txt similarity index 100% rename from test/Report/log.txt rename to tests/Report/log.txt diff --git a/test/Report/report.empty.txt b/tests/Report/report.empty.txt similarity index 100% rename from test/Report/report.empty.txt rename to tests/Report/report.empty.txt diff --git a/test/Report/report.txt b/tests/Report/report.txt similarity index 100% rename from test/Report/report.txt rename to tests/Report/report.txt diff --git a/test/Split/OneOnOneSplittingStrategyTest.php b/tests/Split/OneOnOneSplittingStrategyTest.php similarity index 97% rename from test/Split/OneOnOneSplittingStrategyTest.php rename to tests/Split/OneOnOneSplittingStrategyTest.php index cd7d3a2..e25a4b7 100644 --- a/test/Split/OneOnOneSplittingStrategyTest.php +++ b/tests/Split/OneOnOneSplittingStrategyTest.php @@ -15,7 +15,7 @@ */ class OneOnOneSplittingStrategyTest extends TestCase { - public function testResolveChunk() + public function testResolveChunk(): void { $one_on_one_splitting_strategy = new OneOnOneSplittingStrategy(); $one_on_one_splitting_strategy_with_exclusion = new OneOnOneSplittingStrategy('', ['/dev/hda1']); diff --git a/test/fixtures/node_modules/bar/baz.js b/tests/fixtures/node_modules/bar/baz.js similarity index 100% rename from test/fixtures/node_modules/bar/baz.js rename to tests/fixtures/node_modules/bar/baz.js diff --git a/test/fixtures/node_modules/bar/foo/bar/index.js b/tests/fixtures/node_modules/bar/foo/bar/index.js similarity index 100% rename from test/fixtures/node_modules/bar/foo/bar/index.js rename to tests/fixtures/node_modules/bar/foo/bar/index.js diff --git a/test/fixtures/node_modules/bar/foo/hom.js b/tests/fixtures/node_modules/bar/foo/hom.js similarity index 100% rename from test/fixtures/node_modules/bar/foo/hom.js rename to tests/fixtures/node_modules/bar/foo/hom.js diff --git a/test/fixtures/node_modules/jquery/jquery.js b/tests/fixtures/node_modules/jquery/jquery.js similarity index 100% rename from test/fixtures/node_modules/jquery/jquery.js rename to tests/fixtures/node_modules/jquery/jquery.js diff --git a/test/fixtures/node_modules/jquery/package.json b/tests/fixtures/node_modules/jquery/package.json similarity index 100% rename from test/fixtures/node_modules/jquery/package.json rename to tests/fixtures/node_modules/jquery/package.json diff --git a/test/fixtures/node_modules/module_index/index.js b/tests/fixtures/node_modules/module_index/index.js similarity index 100% rename from test/fixtures/node_modules/module_index/index.js rename to tests/fixtures/node_modules/module_index/index.js diff --git a/test/fixtures/node_modules/module_package/main.js b/tests/fixtures/node_modules/module_package/main.js similarity index 100% rename from test/fixtures/node_modules/module_package/main.js rename to tests/fixtures/node_modules/module_package/main.js diff --git a/test/fixtures/node_modules/module_package/package.json b/tests/fixtures/node_modules/module_package/package.json similarity index 100% rename from test/fixtures/node_modules/module_package/package.json rename to tests/fixtures/node_modules/module_package/package.json diff --git a/test/fixtures/node_modules/module_package/subpackage/main.js b/tests/fixtures/node_modules/module_package/subpackage/main.js similarity index 100% rename from test/fixtures/node_modules/module_package/subpackage/main.js rename to tests/fixtures/node_modules/module_package/subpackage/main.js diff --git a/test/fixtures/node_modules/module_package_dir/package.json b/tests/fixtures/node_modules/module_package_dir/package.json similarity index 100% rename from test/fixtures/node_modules/module_package_dir/package.json rename to tests/fixtures/node_modules/module_package_dir/package.json diff --git a/test/fixtures/node_modules/module_package_dir/src/index.js b/tests/fixtures/node_modules/module_package_dir/src/index.js similarity index 100% rename from test/fixtures/node_modules/module_package_dir/src/index.js rename to tests/fixtures/node_modules/module_package_dir/src/index.js diff --git a/test/fixtures/resolver/js/foo-dir/index.js b/tests/fixtures/resolver/js/foo-dir/index.js similarity index 100% rename from test/fixtures/resolver/js/foo-dir/index.js rename to tests/fixtures/resolver/js/foo-dir/index.js diff --git a/test/fixtures/resolver/js/foo-json/index.json b/tests/fixtures/resolver/js/foo-json/index.json similarity index 100% rename from test/fixtures/resolver/js/foo-json/index.json rename to tests/fixtures/resolver/js/foo-json/index.json diff --git a/test/fixtures/resolver/js/foo-node/index.node b/tests/fixtures/resolver/js/foo-node/index.node similarity index 100% rename from test/fixtures/resolver/js/foo-node/index.node rename to tests/fixtures/resolver/js/foo-node/index.node diff --git a/test/fixtures/resolver/js/relative.js b/tests/fixtures/resolver/js/relative.js similarity index 100% rename from test/fixtures/resolver/js/relative.js rename to tests/fixtures/resolver/js/relative.js diff --git a/test/fixtures/resolver/js/require-syntax/double_quote.js b/tests/fixtures/resolver/js/require-syntax/double_quote.js similarity index 100% rename from test/fixtures/resolver/js/require-syntax/double_quote.js rename to tests/fixtures/resolver/js/require-syntax/double_quote.js diff --git a/test/fixtures/resolver/js/require-syntax/main.js b/tests/fixtures/resolver/js/require-syntax/main.js similarity index 100% rename from test/fixtures/resolver/js/require-syntax/main.js rename to tests/fixtures/resolver/js/require-syntax/main.js diff --git a/test/fixtures/resolver/js/require-syntax/red_haring.js b/tests/fixtures/resolver/js/require-syntax/red_haring.js similarity index 100% rename from test/fixtures/resolver/js/require-syntax/red_haring.js rename to tests/fixtures/resolver/js/require-syntax/red_haring.js diff --git a/test/fixtures/resolver/js/require-syntax/relative.js b/tests/fixtures/resolver/js/require-syntax/relative.js similarity index 100% rename from test/fixtures/resolver/js/require-syntax/relative.js rename to tests/fixtures/resolver/js/require-syntax/relative.js diff --git a/test/fixtures/resolver/js/require-syntax/single_quote.js b/tests/fixtures/resolver/js/require-syntax/single_quote.js similarity index 100% rename from test/fixtures/resolver/js/require-syntax/single_quote.js rename to tests/fixtures/resolver/js/require-syntax/single_quote.js diff --git a/test/fixtures/resolver/less/import-syntax/base.css b/tests/fixtures/resolver/less/import-syntax/base.css similarity index 100% rename from test/fixtures/resolver/less/import-syntax/base.css rename to tests/fixtures/resolver/less/import-syntax/base.css diff --git a/test/fixtures/resolver/less/import-syntax/double_quote.less b/tests/fixtures/resolver/less/import-syntax/double_quote.less similarity index 100% rename from test/fixtures/resolver/less/import-syntax/double_quote.less rename to tests/fixtures/resolver/less/import-syntax/double_quote.less diff --git a/test/fixtures/resolver/less/import-syntax/main.less b/tests/fixtures/resolver/less/import-syntax/main.less similarity index 100% rename from test/fixtures/resolver/less/import-syntax/main.less rename to tests/fixtures/resolver/less/import-syntax/main.less diff --git a/test/fixtures/resolver/less/import-syntax/media-print-extra.css b/tests/fixtures/resolver/less/import-syntax/media-print-extra.css similarity index 100% rename from test/fixtures/resolver/less/import-syntax/media-print-extra.css rename to tests/fixtures/resolver/less/import-syntax/media-print-extra.css diff --git a/test/fixtures/resolver/less/import-syntax/media-print.css b/tests/fixtures/resolver/less/import-syntax/media-print.css similarity index 100% rename from test/fixtures/resolver/less/import-syntax/media-print.css rename to tests/fixtures/resolver/less/import-syntax/media-print.css diff --git a/test/fixtures/resolver/less/import-syntax/non-url.css b/tests/fixtures/resolver/less/import-syntax/non-url.css similarity index 100% rename from test/fixtures/resolver/less/import-syntax/non-url.css rename to tests/fixtures/resolver/less/import-syntax/non-url.css diff --git a/test/fixtures/resolver/less/import-syntax/options.less b/tests/fixtures/resolver/less/import-syntax/options.less similarity index 100% rename from test/fixtures/resolver/less/import-syntax/options.less rename to tests/fixtures/resolver/less/import-syntax/options.less diff --git a/test/fixtures/resolver/less/import-syntax/print-tv.css b/tests/fixtures/resolver/less/import-syntax/print-tv.css similarity index 100% rename from test/fixtures/resolver/less/import-syntax/print-tv.css rename to tests/fixtures/resolver/less/import-syntax/print-tv.css diff --git a/test/fixtures/resolver/less/import-syntax/print.css b/tests/fixtures/resolver/less/import-syntax/print.css similarity index 100% rename from test/fixtures/resolver/less/import-syntax/print.css rename to tests/fixtures/resolver/less/import-syntax/print.css diff --git a/test/fixtures/resolver/less/import-syntax/relative.less b/tests/fixtures/resolver/less/import-syntax/relative.less similarity index 100% rename from test/fixtures/resolver/less/import-syntax/relative.less rename to tests/fixtures/resolver/less/import-syntax/relative.less diff --git a/test/fixtures/resolver/less/import-syntax/single_quote.less b/tests/fixtures/resolver/less/import-syntax/single_quote.less similarity index 100% rename from test/fixtures/resolver/less/import-syntax/single_quote.less rename to tests/fixtures/resolver/less/import-syntax/single_quote.less diff --git a/test/fixtures/resolver/less/relative.less b/tests/fixtures/resolver/less/relative.less similarity index 100% rename from test/fixtures/resolver/less/relative.less rename to tests/fixtures/resolver/less/relative.less diff --git a/test/fixtures/resolver/ts/angular/app.component.ts b/tests/fixtures/resolver/ts/angular/app.component.ts similarity index 100% rename from test/fixtures/resolver/ts/angular/app.component.ts rename to tests/fixtures/resolver/ts/angular/app.component.ts diff --git a/test/fixtures/resolver/ts/dts-module/Foo.d.ts b/tests/fixtures/resolver/ts/dts-module/Foo.d.ts similarity index 100% rename from test/fixtures/resolver/ts/dts-module/Foo.d.ts rename to tests/fixtures/resolver/ts/dts-module/Foo.d.ts diff --git a/test/fixtures/resolver/ts/dts-module/Foo.ts b/tests/fixtures/resolver/ts/dts-module/Foo.ts similarity index 100% rename from test/fixtures/resolver/ts/dts-module/Foo.ts rename to tests/fixtures/resolver/ts/dts-module/Foo.ts diff --git a/test/fixtures/resolver/ts/dts-module/JQuery.d.ts b/tests/fixtures/resolver/ts/dts-module/JQuery.d.ts similarity index 100% rename from test/fixtures/resolver/ts/dts-module/JQuery.d.ts rename to tests/fixtures/resolver/ts/dts-module/JQuery.d.ts diff --git a/test/fixtures/resolver/ts/dts-module/main.ts b/tests/fixtures/resolver/ts/dts-module/main.ts similarity index 100% rename from test/fixtures/resolver/ts/dts-module/main.ts rename to tests/fixtures/resolver/ts/dts-module/main.ts diff --git a/test/fixtures/resolver/ts/import-syntax/Alias.ts b/tests/fixtures/resolver/ts/import-syntax/Alias.ts similarity index 100% rename from test/fixtures/resolver/ts/import-syntax/Alias.ts rename to tests/fixtures/resolver/ts/import-syntax/Alias.ts diff --git a/test/fixtures/resolver/ts/import-syntax/All.ts b/tests/fixtures/resolver/ts/import-syntax/All.ts similarity index 100% rename from test/fixtures/resolver/ts/import-syntax/All.ts rename to tests/fixtures/resolver/ts/import-syntax/All.ts diff --git a/test/fixtures/resolver/ts/import-syntax/Array.d.ts b/tests/fixtures/resolver/ts/import-syntax/Array.d.ts similarity index 100% rename from test/fixtures/resolver/ts/import-syntax/Array.d.ts rename to tests/fixtures/resolver/ts/import-syntax/Array.d.ts diff --git a/test/fixtures/resolver/ts/import-syntax/DoubleQuote.ts b/tests/fixtures/resolver/ts/import-syntax/DoubleQuote.ts similarity index 100% rename from test/fixtures/resolver/ts/import-syntax/DoubleQuote.ts rename to tests/fixtures/resolver/ts/import-syntax/DoubleQuote.ts diff --git a/test/fixtures/resolver/ts/import-syntax/Import.ts b/tests/fixtures/resolver/ts/import-syntax/Import.ts similarity index 100% rename from test/fixtures/resolver/ts/import-syntax/Import.ts rename to tests/fixtures/resolver/ts/import-syntax/Import.ts diff --git a/test/fixtures/resolver/ts/import-syntax/Multiple.ts b/tests/fixtures/resolver/ts/import-syntax/Multiple.ts similarity index 100% rename from test/fixtures/resolver/ts/import-syntax/Multiple.ts rename to tests/fixtures/resolver/ts/import-syntax/Multiple.ts diff --git a/test/fixtures/resolver/ts/import-syntax/Multiple2.ts b/tests/fixtures/resolver/ts/import-syntax/Multiple2.ts similarity index 100% rename from test/fixtures/resolver/ts/import-syntax/Multiple2.ts rename to tests/fixtures/resolver/ts/import-syntax/Multiple2.ts diff --git a/test/fixtures/resolver/ts/import-syntax/Simple.ts b/tests/fixtures/resolver/ts/import-syntax/Simple.ts similarity index 100% rename from test/fixtures/resolver/ts/import-syntax/Simple.ts rename to tests/fixtures/resolver/ts/import-syntax/Simple.ts diff --git a/test/fixtures/resolver/ts/import-syntax/SingleQuote.ts b/tests/fixtures/resolver/ts/import-syntax/SingleQuote.ts similarity index 100% rename from test/fixtures/resolver/ts/import-syntax/SingleQuote.ts rename to tests/fixtures/resolver/ts/import-syntax/SingleQuote.ts diff --git a/test/fixtures/resolver/ts/import-syntax/main.ts b/tests/fixtures/resolver/ts/import-syntax/main.ts similarity index 100% rename from test/fixtures/resolver/ts/import-syntax/main.ts rename to tests/fixtures/resolver/ts/import-syntax/main.ts diff --git a/test/fixtures/resolver/ts/import-syntax/module.js b/tests/fixtures/resolver/ts/import-syntax/module.js similarity index 100% rename from test/fixtures/resolver/ts/import-syntax/module.js rename to tests/fixtures/resolver/ts/import-syntax/module.js diff --git a/test/fixtures/some_other_location/uikit/index.js b/tests/fixtures/some_other_location/uikit/index.js similarity index 100% rename from test/fixtures/some_other_location/uikit/index.js rename to tests/fixtures/some_other_location/uikit/index.js