diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index f6951ea..0000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,36 +0,0 @@ -name: tests - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - php: - - '7.2.x' - - '7.3.x' - - steps: - - uses: actions/checkout@v1 - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest - - - name: Check coding style - run: composer cs-check - - - name: Static analysis tool - run: composer psalm - - - name: Run test suite - run: composer test-coverage - - - name: Upload coverage results - run: | - wget https://scrutinizer-ci.com/ocular.phar - php ocular.phar code-coverage:upload --format=php-clover clover.xml diff --git a/composer.json b/composer.json index 2e6faad..c689c0a 100644 --- a/composer.json +++ b/composer.json @@ -38,7 +38,8 @@ }, "autoload-dev": { "psr-4": { - "MobicmsTest\\": "test" + "Test\\Suite\\": "tests/testsuite", + "Test\\Support\\": "tests/support/" } }, "scripts": { diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 7ed80ac..e222a3a 100755 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -5,7 +5,7 @@ colors="true"> - ./test + ./tests diff --git a/test/Extension/DummyExtensionInterface.php b/test/Extension/DummyExtensionInterface.php deleted file mode 100644 index 1162176..0000000 --- a/test/Extension/DummyExtensionInterface.php +++ /dev/null @@ -1,19 +0,0 @@ -assertFalse($this->engine->doesFunctionExist('foo')); - $this->engine->loadExtension(new DummyExtensionFoo()); + $this->engine->loadExtension(new FakeExtension()); $this->assertTrue($this->engine->doesFunctionExist('foo')); } diff --git a/test/Template/TemplateDataTest.php b/tests/testsuite/Template/TemplateDataTest.php similarity index 98% rename from test/Template/TemplateDataTest.php rename to tests/testsuite/Template/TemplateDataTest.php index 4519256..ca1d96f 100644 --- a/test/Template/TemplateDataTest.php +++ b/tests/testsuite/Template/TemplateDataTest.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace MobicmsTest; +namespace Test\Suite\Template; use Mobicms\Render\Template\TemplateData; use PHPUnit\Framework\TestCase; diff --git a/test/Template/TemplateFunctionTest.php b/tests/testsuite/Template/TemplateFunctionTest.php similarity index 92% rename from test/Template/TemplateFunctionTest.php rename to tests/testsuite/Template/TemplateFunctionTest.php index 625be49..313a65e 100644 --- a/test/Template/TemplateFunctionTest.php +++ b/tests/testsuite/Template/TemplateFunctionTest.php @@ -9,11 +9,11 @@ declare(strict_types=1); -namespace MobicmsTest; +namespace Test\Suite\Template; use Mobicms\Render\Template\TemplateFunction; use LogicException; -use MobicmsTest\Extension\DummyExtensionInterface; +use Test\Support\FakeExtension; use PHPUnit\Framework\TestCase; class TemplateFunctionTest extends TestCase @@ -68,7 +68,7 @@ public function testFunctionCall(): void public function testExtensionFunctionCall(): void { - $extension = $this->createPartialMock(DummyExtensionInterface::class, ['register', 'foo']); + $extension = $this->createPartialMock(FakeExtension::class, ['register', 'foo']); $extension->method('foo')->willReturn('bar'); $this->function->setCallback([$extension, 'foo']); $this->assertEquals($this->function->call(), 'bar'); diff --git a/test/Template/TemplateNameTest.php b/tests/testsuite/Template/TemplateNameTest.php similarity index 98% rename from test/Template/TemplateNameTest.php rename to tests/testsuite/Template/TemplateNameTest.php index a216e8d..976c37c 100644 --- a/test/Template/TemplateNameTest.php +++ b/tests/testsuite/Template/TemplateNameTest.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace MobicmsTest; +namespace Test\Suite\Template; use Mobicms\Render\Engine; use Mobicms\Render\Template\TemplateName; diff --git a/test/Template/TemplateTest.php b/tests/testsuite/Template/TemplateTest.php similarity index 99% rename from test/Template/TemplateTest.php rename to tests/testsuite/Template/TemplateTest.php index 93afbf8..27fb6e5 100644 --- a/test/Template/TemplateTest.php +++ b/tests/testsuite/Template/TemplateTest.php @@ -9,7 +9,7 @@ declare(strict_types=1); -namespace MobicmsTest; +namespace Test\Suite\Template; use Mobicms\Render\Engine; use Mobicms\Render\Template\Template;