diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f71e76e..d4c3c66 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,7 +11,7 @@ jobs: fail-fast: false matrix: #php-versions: [ '7.3', '7.4', '8.0' ] - php-versions: [ '7.2', '7.3', '7.4' ] + php-versions: [ '7.2', '7.3', '7.4', '8.0' ] steps: - name: Checkout diff --git a/README.md b/README.md index a8a8db1..f1f7ddb 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Requirements * PHP >= 7.2.0 -This library is unit tested against PHP 7.2, 7.3 and 7.4! +This library is unit tested against PHP 7.2, 7.3, 7.4 and 8.0! License ------- diff --git a/composer.json b/composer.json index 5ae28b6..f4e051a 100644 --- a/composer.json +++ b/composer.json @@ -16,7 +16,7 @@ "php": ">=7.2.0" }, "require-dev": { - "phpunit/phpunit": "5.7.*" + "phpunit/phpunit": "^8.0" }, "autoload": { "psr-4": { diff --git a/phpunit.xml b/phpunit.xml index ef21038..7f648a3 100644 --- a/phpunit.xml +++ b/phpunit.xml @@ -9,7 +9,6 @@ processIsolation="false" stopOnError="false" stopOnFailure="false" - syntaxCheck="true" verbose="true" > diff --git a/tests/ConfigurationTest.php b/tests/ConfigurationTest.php index 8916de2..adb4f84 100644 --- a/tests/ConfigurationTest.php +++ b/tests/ConfigurationTest.php @@ -1,5 +1,7 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html - * @link https://github.com/bobsta63/linguist + * @link https://github.com/allebb/linguist * @link http://www.bobbyallen.me * */ -class ConfigurationTest extends \PHPUnit_Framework_TestCase +class ConfigurationTest extends TestCase { /** @@ -37,9 +39,15 @@ public function testCustomTagConfiguaration() { $instance = new Configuration(); $instance->push('assignment', 'assign>', 'https://exampleapp.com/assign/%s'); - $this->assertArrayHasKey('assignment', $instance->get()); // Check that custom assignment section has been added... + $this->assertArrayHasKey( + 'assignment', + $instance->get() + ); // Check that custom assignment section has been added... $instance->drop('assignment'); - $this->assertArrayNotHasKey('assignment', $instance->get()); // Check that the custom config has been removed successfully. + $this->assertArrayNotHasKey( + 'assignment', + $instance->get() + ); // Check that the custom config has been removed successfully. } /** diff --git a/tests/ParserTest.php b/tests/ParserTest.php index 5e0df4e..a32f127 100644 --- a/tests/ParserTest.php +++ b/tests/ParserTest.php @@ -1,6 +1,8 @@ * @license http://www.gnu.org/licenses/gpl-3.0.html - * @link https://github.com/bobsta63/linguist + * @link https://github.com/allebb/linguist * @link http://www.bobbyallen.me * */ -class ParserTest extends \PHPUnit_Framework_TestCase +class ParserTest extends TestCase { const EXAMPLE_TWEET_1 = "Hey @bobsta63, this example is for parsing plain-text tweet strings into HTML right? #questions #howto"; @@ -24,13 +26,19 @@ class ParserTest extends \PHPUnit_Framework_TestCase public function testTwitterExampleToHtml() { $instance = new TagParser(self::EXAMPLE_TWEET_1, (new TagConfiguration)->loadDefault()); - $this->assertEquals('Hey @bobsta63, this example is for parsing plain-text tweet strings into HTML right? #questions #howto', $instance->html()->get()); + $this->assertEquals( + 'Hey @bobsta63, this example is for parsing plain-text tweet strings into HTML right? #questions #howto', + $instance->html()->get() + ); } public function testTwitterExampleToMarkdown() { $instance = new TagParser(self::EXAMPLE_TWEET_1, (new TagConfiguration)->loadDefault()); - $this->assertEquals('Hey [https://twitter.com/bobsta63](@bobsta63), this example is for parsing plain-text tweet strings into HTML right? [https://twitter.com/hashtag/questions](#questions) [https://twitter.com/hashtag/howto](#howto)', $instance->markdown()->get()); + $this->assertEquals( + 'Hey [https://twitter.com/bobsta63](@bobsta63), this example is for parsing plain-text tweet strings into HTML right? [https://twitter.com/hashtag/questions](#questions) [https://twitter.com/hashtag/howto](#howto)', + $instance->markdown()->get() + ); } public function testTwitterExampleGetMentions() @@ -62,14 +70,14 @@ public function testGetTopicConfigurationArray() public function testGetInvalidTagArray() { $instance = new TagParser(self::EXAMPLE_TWEET_1, (new TagConfiguration)->loadDefault()); - $this->setExpectedException('\InvalidArgumentException', 'The tag "locations" has no results.'); + $this->expectException('\InvalidArgumentException', 'The tag "locations" has no results.'); $instance->tags('locations'); } public function testGetInvalidTagConfigurationArray() { $instance = new TagParser(self::EXAMPLE_TWEET_1, (new TagConfiguration)->loadDefault()); - $this->setExpectedException('\InvalidArgumentException', 'The tag "locations" is not registered!'); + $this->expectException('\InvalidArgumentException', 'The tag "locations" is not registered!'); $instance->tag('locations'); } @@ -98,17 +106,19 @@ public function testCallTagsUsingInvalidTagMagicMethod() $custom_config = new TagConfiguration(); $custom_config->loadDefault(); $instance = new TagParser(self::EXAMPLE_TWEET_1, $custom_config); - $this->setExpectedException('RuntimeException', 'Invalid tag type(s) requested.'); + $this->expectException('RuntimeException', 'Invalid tag type(s) requested.'); $this->assertEquals(1, count($instance->assignment())); } public function testHtmlTransformerWithLink() { - $custom_config = new TagConfiguration(); $custom_config->push('assignment', 'assign>', 'https://exampleapp.com/assign/%s', true, 'btn btn-link'); $instance = new TagParser(self::EXAMPLE_TWEET_2); $instance->setConfiguration($custom_config); - $this->assertEquals('An example support ticket reply, assign>bobby this will attempt to reassign this ticket example (to an agent who is called \'bobby\').', $instance->html()->get()); + $this->assertEquals( + 'An example support ticket reply, assign>bobby this will attempt to reassign this ticket example (to an agent who is called \'bobby\').', + $instance->html()->get() + ); } }