From 2f54ee75b797e866a106ab421a4037342e594d30 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Tue, 6 May 2014 11:18:04 +0200 Subject: [PATCH] Organized tests file structure --- .../AddCommentJobTest.php} | 2 +- .../DeleteCommentJobTest.php} | 2 +- .../EditCommentJobTest.php} | 2 +- .../ListCommentsJobTest.php} | 2 +- .../PreviewCommentJobTest.php} | 2 +- .../LoggerTest.php} | 18 +----------------- tests/MiscTests/TextHelperTest.php | 19 +++++++++++++++++++ tests/run-all.php | 17 +++++++++++++---- 8 files changed, 38 insertions(+), 26 deletions(-) rename tests/{CommentAddTest.php => JobTests/AddCommentJobTest.php} (98%) rename tests/{CommentDeleteTest.php => JobTests/DeleteCommentJobTest.php} (97%) rename tests/{CommentEditTest.php => JobTests/EditCommentJobTest.php} (98%) rename tests/{CommentListTest.php => JobTests/ListCommentsJobTest.php} (97%) rename tests/{CommentPreviewTest.php => JobTests/PreviewCommentJobTest.php} (97%) rename tests/{MiscTest.php => MiscTests/LoggerTest.php} (64%) create mode 100644 tests/MiscTests/TextHelperTest.php diff --git a/tests/CommentAddTest.php b/tests/JobTests/AddCommentJobTest.php similarity index 98% rename from tests/CommentAddTest.php rename to tests/JobTests/AddCommentJobTest.php index c8a5ca6b..f301826f 100644 --- a/tests/CommentAddTest.php +++ b/tests/JobTests/AddCommentJobTest.php @@ -1,5 +1,5 @@ assert->areEqual($text, TextHelper::decrypt(TextHelper::encrypt($text))); - } - } - public function testLogging() { $logPath = __DIR__ . '/logs/{yyyy}-{mm}-{dd}.log'; diff --git a/tests/MiscTests/TextHelperTest.php b/tests/MiscTests/TextHelperTest.php new file mode 100644 index 00000000..e50035c3 --- /dev/null +++ b/tests/MiscTests/TextHelperTest.php @@ -0,0 +1,19 @@ +assert->areEqual($text, TextHelper::decrypt(TextHelper::encrypt($text))); + } + } +} diff --git a/tests/run-all.php b/tests/run-all.php index 02f286ef..e5628403 100644 --- a/tests/run-all.php +++ b/tests/run-all.php @@ -1,4 +1,8 @@ getPathname(); + if (preg_match('/.*Test.php$/', $path)) + $testFiles []= $path; + } + + $testClasses = \Chibi\Util\Reflection::loadClasses($testFiles); if ($filter !== null) {