From 468302521081b02a452ba5f8e9ec0c708dd722b0 Mon Sep 17 00:00:00 2001 From: Adam Backstrom Date: Thu, 25 Jul 2013 13:25:26 -0400 Subject: [PATCH] Add some rudimentary tests --- Makefile | 2 ++ tests/ActionDateCTest.php | 14 ++++++++++++++ tests/ActionQuotedPrintableDecodeTest.php | 8 ++++++++ tests/ActionQuotedPrintableEncodeTest.php | 8 ++++++++ tests/bootstrap.php | 7 +++++++ 5 files changed, 39 insertions(+) create mode 100644 Makefile create mode 100644 tests/ActionDateCTest.php create mode 100644 tests/ActionQuotedPrintableDecodeTest.php create mode 100644 tests/ActionQuotedPrintableEncodeTest.php create mode 100644 tests/bootstrap.php diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..e9972b4 --- /dev/null +++ b/Makefile @@ -0,0 +1,2 @@ +test: + phpunit --bootstrap tests/bootstrap.php tests diff --git a/tests/ActionDateCTest.php b/tests/ActionDateCTest.php new file mode 100644 index 0000000..57e6b5f --- /dev/null +++ b/tests/ActionDateCTest.php @@ -0,0 +1,14 @@ + '2013-07-25T17:15:15+00:00']; + $this->assertEquals($expected, $action->decode()); + } + + function testDecodeHasCorrectNumberOfResults() { + $action = new ActionDateC("1374772515\n1374772516"); + $this->assertCount(2, $action->decode()); + } +} diff --git a/tests/ActionQuotedPrintableDecodeTest.php b/tests/ActionQuotedPrintableDecodeTest.php new file mode 100644 index 0000000..2c11c49 --- /dev/null +++ b/tests/ActionQuotedPrintableDecodeTest.php @@ -0,0 +1,8 @@ +assertEquals('a=b', $action->decode()); + } +} diff --git a/tests/ActionQuotedPrintableEncodeTest.php b/tests/ActionQuotedPrintableEncodeTest.php new file mode 100644 index 0000000..3424487 --- /dev/null +++ b/tests/ActionQuotedPrintableEncodeTest.php @@ -0,0 +1,8 @@ +assertEquals('a=3Db', $action->decode()); + } +} diff --git a/tests/bootstrap.php b/tests/bootstrap.php new file mode 100644 index 0000000..f5fcfb3 --- /dev/null +++ b/tests/bootstrap.php @@ -0,0 +1,7 @@ +