From c994cf789fb8b008c92127578ed1d7c46f7f0b6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Lucas?= Date: Thu, 3 Oct 2013 08:38:58 +0200 Subject: [PATCH] Add basic unit testing. re #96 --- .travis.yml | 5 +++++ phpunit.xml | 7 +++++++ test/baseTest.php | 14 ++++++++++++++ test/config_test.php | 4 ++++ 4 files changed, 30 insertions(+) create mode 100644 .travis.yml create mode 100644 phpunit.xml create mode 100644 test/baseTest.php create mode 100644 test/config_test.php diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..03ea145 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,5 @@ +language: php +php: + - 5.5 + - 5.4 + - 5.3 \ No newline at end of file diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..568c34c --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,7 @@ + + + + test + + + \ No newline at end of file diff --git a/test/baseTest.php b/test/baseTest.php new file mode 100644 index 0000000..78b6e35 --- /dev/null +++ b/test/baseTest.php @@ -0,0 +1,14 @@ +assertEquals ("?db=0", addURLParameter ("?", "db", "0")); + $this->assertEquals ("?key=value&db=0", addURLParameter ("?key=value", "db", "0")); + $this->assertEquals ("?key=value&otherKey=&db=0", addURLParameter ("?key=value&otherKey", "db", "0")); + } +} \ No newline at end of file diff --git a/test/config_test.php b/test/config_test.php new file mode 100644 index 0000000..d2f03ce --- /dev/null +++ b/test/config_test.php @@ -0,0 +1,4 @@ +