From 30670338ce1218f3ea2fd0c9e6cff814c45958d9 Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Sun, 28 Jun 2020 17:25:21 +0200 Subject: [PATCH 1/2] drone pipeline: install dev dependencies for unit tests --- .drone.yml | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index d2658c8..b322402 100644 --- a/.drone.yml +++ b/.drone.yml @@ -4,7 +4,22 @@ type: docker name: default steps: - - name: install + - name: install dependencies + image: composer + volumes: + - name: composer-cache + path: /tmp/cache + environment: + COMPOSER_CACHE_DIR: /tmp/cache + commands: + - composer install --no-progress --no-interaction + + - name: run unit tests + image: php:7.4 + commands: + - vendor/bin/phpunit -c phpunit.xml + + - name: remove dev dependencies image: composer volumes: - name: composer-cache @@ -14,11 +29,6 @@ steps: commands: - composer install --no-progress --no-interaction --no-dev --optimize-autoloader - - name: unit tests - image: php:7.4 - commands: - - vendor/bin/phpunit -c phpunit.xml - - name: build image image: docker volumes: From 2a0af653cb0bd0eea8aaffccd2dcb97466d44dfa Mon Sep 17 00:00:00 2001 From: binaryDiv Date: Sun, 28 Jun 2020 17:26:46 +0200 Subject: [PATCH 2/2] fix unit test --- tests/unit/HelloWorldTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/unit/HelloWorldTest.php b/tests/unit/HelloWorldTest.php index f0e9b8f..9306ed2 100644 --- a/tests/unit/HelloWorldTest.php +++ b/tests/unit/HelloWorldTest.php @@ -14,6 +14,6 @@ final class HelloWorldTest extends TestCase public function testGetHello(): void { $hello = new HelloWorld(); - $this->assertSame('Hello Drone! :3', $hello->getHello()); + $this->assertSame('Hello world! :3', $hello->getHello()); } }