Skip to content

Commit

Permalink
Add Travis CI (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
peter279k authored and kelunik committed Feb 28, 2019
1 parent 1568305 commit 58f9a1e
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 20 deletions.
16 changes: 16 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
language: php

php:
- 7.1
- 7.2
- 7.3

cache:
directories:
- vendor

install:
- composer install

script:
- vendor/bin/phpunit
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
40 changes: 20 additions & 20 deletions test/BuilderGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BuilderGeneratorTest extends TestCase
/** @var string */
private $result;

public function setUp(): void
protected function setUp(): void
{
$this->reflection = new BetterReflection;
}
Expand All @@ -31,7 +31,7 @@ public function test_public_property(): void
{
$this->givenSource('Foo', <<<SOURCE
<?php
class Foo {
public \$bar;
}
Expand Down Expand Up @@ -99,7 +99,7 @@ public function test_public_property_typed(): void
{
$this->givenSource('Foo', <<<SOURCE
<?php
class Foo {
/** @var string */
public \$bar;
Expand Down Expand Up @@ -142,7 +142,7 @@ public function test_public_property_typed_nullable(): void
{
$this->givenSource('Foo', <<<SOURCE
<?php
class Foo {
/** @var string|null */
public \$bar;
Expand Down Expand Up @@ -185,7 +185,7 @@ public function test_private_property(): void
{
$this->givenSource('Foo', <<<SOURCE
<?php
class Foo {
private \$bar;
}
Expand Down Expand Up @@ -220,7 +220,7 @@ public function test_namespace(): void
{
$this->givenSource('App\\Foo', <<<SOURCE
<?php
namespace App;
class Foo {}
Expand Down Expand Up @@ -259,10 +259,10 @@ public function test_public_setter(): void
{
$this->givenSource('Foo', <<<SOURCE
<?php
class Foo {
private \$bar;
public function setBar(string \$bar): void
{
\$this->bar = \$bar;
Expand Down Expand Up @@ -306,10 +306,10 @@ public function test_public_setter_nullable(): void
{
$this->givenSource('Foo', <<<SOURCE
<?php
class Foo {
private \$bar;
public function setBar(?string \$bar): void
{
\$this->bar = \$bar;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -406,10 +406,10 @@ public function test_public_setter_default_value(): void
{
$this->givenSource('Foo', <<<SOURCE
<?php
class Foo {
private \$bar;
public function setBar(?string \$bar = 'foo'): void
{
\$this->bar = \$bar;
Expand Down Expand Up @@ -453,12 +453,12 @@ public function test_public_setter_default_value_constant(): void
{
$this->givenSource('Foo', <<<SOURCE
<?php
class Foo {
const X = 'Y';
const X = 'Y';
private \$bar;
public function setBar(?string \$bar = self::X): void
{
\$this->bar = \$bar;
Expand Down Expand Up @@ -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', <<<SOURCE
<?php
class Foo {
private const X = 'Y';
private const X = 'Y';
private \$bar;
public function setBar(?string \$bar = self::X): void
{
\$this->bar = \$bar;
Expand Down Expand Up @@ -547,4 +547,4 @@ final public function build(): Foo
SOURCE
);
}
}
}

0 comments on commit 58f9a1e

Please sign in to comment.