diff --git a/tests/TODO b/tests/TODO index d0ceec3..e50ae4e 100644 --- a/tests/TODO +++ b/tests/TODO @@ -12,5 +12,3 @@ Validate API/AYAH API/Gravatar -API/Tinychat -API/Google/Profanity diff --git a/tests/classes/API/Google/ProfanityTest.php b/tests/classes/API/Google/ProfanityTest.php new file mode 100644 index 0000000..bcdfe12 --- /dev/null +++ b/tests/classes/API/Google/ProfanityTest.php @@ -0,0 +1,29 @@ +assertEquals($b, API_Google_Profanity::check($a)); + } + + public function providerFormatPhoneNumber() + { + return [ + ['alpha', false], + ['beta', false], + ['joshtronic', false], + ['god', false], + ['fck', false], + ['fuck', true], + ['shit', true], + ['cocksucker', true], + ['cuntface', false], // Unsure why not... + ]; + } +} + +?> diff --git a/tests/classes/ConvertTest.php b/tests/classes/ConvertTest.php index ea24d74..132f88a 100644 --- a/tests/classes/ConvertTest.php +++ b/tests/classes/ConvertTest.php @@ -12,14 +12,14 @@ class ConvertTest extends PHPUnit_Framework_TestCase public function providerArrayToXML() { - return array( - array('foo', false, ''), - array(array('foo', 'bar'), false, '<0>foo<1>bar'), - array(array('foo', 'bar'), true, "<0>foo\n<1>bar\n"), - array(array('foo' => 'bar'), false, 'bar'), - array(array('children' => array('child' => array('foo', 'bar'))), false, 'foobar'), - array(array('children' => array('child' => array('foo', 'bar'))), true, "\n\tfoo\n\tbar\n\n"), - ); + return [ + ['foo', false, ''], + [['foo', 'bar'], false, '<0>foo<1>bar'], + [['foo', 'bar'], true, "<0>foo\n<1>bar\n"], + [['foo' => 'bar'], false, 'bar'], + [['children' => ['child' => ['foo', 'bar']]], false, 'foobar'], + [['children' => ['child' => ['foo', 'bar']]], true, "\n\tfoo\n\tbar\n\n"], + ]; } } diff --git a/tests/classes/DateTest.php b/tests/classes/DateTest.php index ea70861..fceb9a5 100644 --- a/tests/classes/DateTest.php +++ b/tests/classes/DateTest.php @@ -16,14 +16,14 @@ class DateTest extends PHPUnit_Framework_TestCase $time = strtotime('-25 years'); - return array( - array(date('Y-m-d', $time), '25'), - array(date('m/d/Y', $time), '25'), - array(date('r', $time), '25'), - array('today', '0'), - array('400 days ago', '1'), - array(true, Date::age('1969-12-31')), - ); + return [ + [date('Y-m-d', $time), '25'], + [date('m/d/Y', $time), '25'], + [date('r', $time), '25'], + ['today', '0'], + ['400 days ago', '1'], + [true, Date::age('1969-12-31')], + ]; } } diff --git a/tests/classes/NumberTest.php b/tests/classes/NumberTest.php index 3ee1513..07054b7 100644 --- a/tests/classes/NumberTest.php +++ b/tests/classes/NumberTest.php @@ -12,16 +12,16 @@ class NumberTest extends PHPUnit_Framework_TestCase public function providerOrginalIndicatorNoSuper() { - return array( - array(1, '1st'), - array(2, '2nd'), - array(3, '3rd'), - array(4, '4th'), - array(51, '51st'), - array(52, '52nd'), - array(53, '53rd'), - array(54, '54th'), - ); + return [ + [1, '1st'], + [2, '2nd'], + [3, '3rd'], + [4, '4th'], + [51, '51st'], + [52, '52nd'], + [53, '53rd'], + [54, '54th'], + ]; } /** @@ -34,16 +34,16 @@ class NumberTest extends PHPUnit_Framework_TestCase public function providerOrginalIndicatorSuper() { - return array( - array(1, '1st'), - array(2, '2nd'), - array(3, '3rd'), - array(4, '4th'), - array(51, '51st'), - array(52, '52nd'), - array(53, '53rd'), - array(54, '54th'), - ); + return [ + [1, '1st'], + [2, '2nd'], + [3, '3rd'], + [4, '4th'], + [51, '51st'], + [52, '52nd'], + [53, '53rd'], + [54, '54th'], + ]; } } diff --git a/tests/classes/StringTest.php b/tests/classes/StringTest.php index 9d3cb09..5145259 100644 --- a/tests/classes/StringTest.php +++ b/tests/classes/StringTest.php @@ -12,17 +12,17 @@ class StringTest extends PHPUnit_Framework_TestCase public function providerFormatPhoneNumber() { - return array( - array('1234567890', '123-456-7890'), - array('123 456 7890', '123-456-7890'), - array('123.456.7890', '123-456-7890'), - array('123_456_7890', '123-456-7890'), - array('1234567890', '123-456-7890'), - array('1234-56-7890', '123-456-7890'), - array('(123) 456-7890', '123-456-7890'), - array('1234567890 x1000', '123-456-7890x1000'), - array('(123) 456-7890_x10.00', '123-456-7890x1000'), - ); + return [ + ['1234567890', '123-456-7890'], + ['123 456 7890', '123-456-7890'], + ['123.456.7890', '123-456-7890'], + ['123_456_7890', '123-456-7890'], + ['1234567890', '123-456-7890'], + ['1234-56-7890', '123-456-7890'], + ['(123) 456-7890', '123-456-7890'], + ['1234567890 x1000', '123-456-7890x1000'], + ['(123) 456-7890_x10.00', '123-456-7890x1000'], + ]; } /** @@ -35,10 +35,10 @@ class StringTest extends PHPUnit_Framework_TestCase public function providerGenerateGravatarHash() { - return array( - array('foo@bar.com', 'f3ada405ce890b6f8204094deb12d8a8'), - array('FOO@BAR.COM', 'f3ada405ce890b6f8204094deb12d8a8'), - ); + return [ + ['foo@bar.com', 'f3ada405ce890b6f8204094deb12d8a8'], + ['FOO@BAR.COM', 'f3ada405ce890b6f8204094deb12d8a8'], + ]; } public function testIsEmpty() @@ -79,12 +79,12 @@ class StringTest extends PHPUnit_Framework_TestCase public function providerTruncate() { - return array( - array('foo bar', 3, true, 'foo…'), - array('foo bar', 3, false, 'foo...'), - array('foo bar', 7, true, 'foo bar'), - array('foo bar', 8, true, 'foo bar'), - ); + return [ + ['foo bar', 3, true, 'foo…'], + ['foo bar', 3, false, 'foo...'], + ['foo bar', 7, true, 'foo bar'], + ['foo bar', 8, true, 'foo bar'], + ]; } /** @@ -97,13 +97,13 @@ class StringTest extends PHPUnit_Framework_TestCase public function providerUpperWords() { - return array( - array('foo bar', 'Foo Bar'), - array('FOO BAR', 'Foo Bar'), - array('fOO bAR', 'Foo Bar'), - array('foo@bar.com', 'foo@bar.com'), - array('FOO@BAR.COM', 'FOO@BAR.COM'), - ); + return [ + ['foo bar', 'Foo Bar'], + ['FOO BAR', 'Foo Bar'], + ['fOO bAR', 'Foo Bar'], + ['foo@bar.com', 'foo@bar.com'], + ['FOO@BAR.COM', 'FOO@BAR.COM'], + ]; } /** @@ -116,13 +116,13 @@ class StringTest extends PHPUnit_Framework_TestCase public function providerGenerateSlug() { - return array( - array('TEST STRING', 'test-string'), - array('Test String', 'test-string'), - array('TEST STRING', 'test-string'), - array('#! Test String', 'test-string'), - array('-test--string-', 'test-string'), - ); + return [ + ['TEST STRING', 'test-string'], + ['Test String', 'test-string'], + ['TEST STRING', 'test-string'], + ['#! Test String', 'test-string'], + ['-test--string-', 'test-string'], + ]; } public function testPluralize()