From 62f513ec1fc56f7e2dd52c33c5314746f2555fa9 Mon Sep 17 00:00:00 2001 From: Jean-Yves Gaulier Date: Wed, 15 Jul 2015 11:36:18 +0200 Subject: [PATCH] bb changes --- .../Utilities/String/CamelizerTest.php | 33 ----------- .../Utilities/String/CrLfNormalizerTest.php | 33 ----------- .../Utilities/String/StringHelperTest.php | 55 +++++++++++++++++++ 3 files changed, 55 insertions(+), 66 deletions(-) delete mode 100644 tests/Alchemy/Tests/Phrasea/Utilities/String/CamelizerTest.php delete mode 100644 tests/Alchemy/Tests/Phrasea/Utilities/String/CrLfNormalizerTest.php create mode 100644 tests/Alchemy/Tests/Phrasea/Utilities/String/StringHelperTest.php diff --git a/tests/Alchemy/Tests/Phrasea/Utilities/String/CamelizerTest.php b/tests/Alchemy/Tests/Phrasea/Utilities/String/CamelizerTest.php deleted file mode 100644 index 0754f36db0..0000000000 --- a/tests/Alchemy/Tests/Phrasea/Utilities/String/CamelizerTest.php +++ /dev/null @@ -1,33 +0,0 @@ -assertEquals($expected, $result); - } - - public function provideStrings() - { - return [ - ['string-test', '-', 'stringTest', false], - ['string test', ' ', 'stringTest', false], - ['string_test', '_', 'stringTest', false], - ['string#test', '#', 'StringTest', true], - ]; - } -} diff --git a/tests/Alchemy/Tests/Phrasea/Utilities/String/CrLfNormalizerTest.php b/tests/Alchemy/Tests/Phrasea/Utilities/String/CrLfNormalizerTest.php deleted file mode 100644 index 39121ae4f0..0000000000 --- a/tests/Alchemy/Tests/Phrasea/Utilities/String/CrLfNormalizerTest.php +++ /dev/null @@ -1,33 +0,0 @@ -assertEquals($expected, $result); - } - - public function provideStrings() - { - return [ - ['ABC\rDEF', 'ABC\nDEF'], - ['ABC\nDEF', 'ABC\nDEF'], - ['ABC\r\nDEF', 'ABC\nDEF'], - ['ABC\n\rDEF', 'ABC\n\nDEF'], - ]; - } -} diff --git a/tests/Alchemy/Tests/Phrasea/Utilities/String/StringHelperTest.php b/tests/Alchemy/Tests/Phrasea/Utilities/String/StringHelperTest.php new file mode 100644 index 0000000000..56013b184c --- /dev/null +++ b/tests/Alchemy/Tests/Phrasea/Utilities/String/StringHelperTest.php @@ -0,0 +1,55 @@ +assertEquals($expected, $result); + } + + public function provideStringsForCamelize() + { + return [ + ['string-test', '-', 'stringTest', false], + ['string test', ' ', 'stringTest', false], + ['string_test', '_', 'stringTest', false], + ['string#test', '#', 'StringTest', true], + ]; + } + + + + /** + * @dataProvider provideStringsForCrLfNormalize + * @covers Alchemy\Phrasea\Utilities\StringHelper::crlfNormalize + */ + public function testCrLfNormalize($string, $expected) + { + $result = StringHelper::crlfNormalize($string); + + $this->assertEquals($expected, $result); + } + + public function provideStringsForCrLfNormalize() + { + return [ + ['ABC\rDEF', 'ABC\nDEF'], + ['ABC\nDEF', 'ABC\nDEF'], + ['ABC\r\nDEF', 'ABC\nDEF'], + ['ABC\n\rDEF', 'ABC\n\nDEF'], + ]; + } +}