diff --git a/.styleci.yml b/.styleci.yml index 2ed9dee..6668a88 100644 --- a/.styleci.yml +++ b/.styleci.yml @@ -2,8 +2,6 @@ preset: PSR2 risky: false -linting: true - enabled: - no_extra_consecutive_blank_lines - no_unused_imports diff --git a/.travis.yml b/.travis.yml index bf62dc6..f36ed72 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,11 @@ php: - 7.0 - 7.1 - 7.2 + - nightly + +matrix: + allow_failures: + - php: nightly before_script: - "composer self-update" diff --git a/tests/Console/Commands/GenerateState/ReaderDatasetTest.php b/tests/Console/Commands/GenerateState/ReaderDatasetTest.php index 1b10b3c..3e1bd43 100644 --- a/tests/Console/Commands/GenerateState/ReaderDatasetTest.php +++ b/tests/Console/Commands/GenerateState/ReaderDatasetTest.php @@ -14,4 +14,24 @@ public function testShouldReadDatasetFile() $this->assertCount(27, $reader); } + + public function testConstructorOnNullFilePath() + { + $reader = new ReaderDataset(null); + $reader->read(); + + $this->assertCount(27, $reader); + } + + public function testGetCurrentStates() + { + $reader = new ReaderDataset(null); + $reader->read(); + $result = $reader->current(); + + $this->assertSame('EstadoDo', $result->getClassName()); + $this->assertSame('Estado do', $result->getFullName()); + $this->assertSame('AC', $result->getShortName()); + $this->assertSame('State', $result->getTimeZone()); + } } diff --git a/tests/StateTest.php b/tests/StateTest.php index d55136b..e41d9c5 100644 --- a/tests/StateTest.php +++ b/tests/StateTest.php @@ -20,6 +20,7 @@ public function testShouldCreateAStateObject($method, $className, $fullName, $sh $this->assertEquals($shortName, $state->shortName, "Failed asserting short for {$fullName}"); $this->assertEquals($code, $state->code, "Failed asserting code for {$fullName}"); $this->assertEquals($timezone, $state->timeZone, "Failed asserting timezone for {$fullName}"); + $this->assertTrue($state->equalTo($state)); } public function provideStates()