From 58f9a1ed508095d2ab5f6613bdcd990c773deb09 Mon Sep 17 00:00:00 2001 From: peter279k Date: Fri, 1 Mar 2019 04:13:51 +0800 Subject: [PATCH] Add Travis CI (#2) --- .travis.yml | 16 ++++++++++++++ composer.json | 1 + test/BuilderGeneratorTest.php | 40 +++++++++++++++++------------------ 3 files changed, 37 insertions(+), 20 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..7850b12 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,16 @@ +language: php + +php: + - 7.1 + - 7.2 + - 7.3 + +cache: + directories: + - vendor + +install: + - composer install + +script: + - vendor/bin/phpunit diff --git a/composer.json b/composer.json index 5613da4..ddca10c 100644 --- a/composer.json +++ b/composer.json @@ -3,6 +3,7 @@ "description": "Generating builders for value objects.", "type": "library", "require": { + "php": "^7.1", "nette/php-generator": "^3.2", "roave/better-reflection": "^3.2" }, diff --git a/test/BuilderGeneratorTest.php b/test/BuilderGeneratorTest.php index f1d6a39..47162b0 100644 --- a/test/BuilderGeneratorTest.php +++ b/test/BuilderGeneratorTest.php @@ -22,7 +22,7 @@ class BuilderGeneratorTest extends TestCase /** @var string */ private $result; - public function setUp(): void + protected function setUp(): void { $this->reflection = new BetterReflection; } @@ -31,7 +31,7 @@ public function test_public_property(): void { $this->givenSource('Foo', <<givenSource('Foo', <<givenSource('Foo', <<givenSource('Foo', <<givenSource('App\\Foo', <<givenSource('Foo', <<bar = \$bar; @@ -306,10 +306,10 @@ public function test_public_setter_nullable(): void { $this->givenSource('Foo', <<bar = \$bar; @@ -358,7 +358,7 @@ public function test_public_setter_nullable_namespaced(): void class Foo { private \$bar; - + public function setBar(?string \$bar): void { \$this->bar = \$bar; @@ -406,10 +406,10 @@ public function test_public_setter_default_value(): void { $this->givenSource('Foo', <<bar = \$bar; @@ -453,12 +453,12 @@ public function test_public_setter_default_value_constant(): void { $this->givenSource('Foo', <<bar = \$bar; @@ -503,12 +503,12 @@ public function test_public_setter_default_value_constant_private(): void // TODO: This should error in a future version, because the constant can't be reused in the builder $this->givenSource('Foo', <<bar = \$bar; @@ -547,4 +547,4 @@ final public function build(): Foo SOURCE ); } -} \ No newline at end of file +}