From 739071715cb5267191e4a5b5824fbc28a2fa3ef4 Mon Sep 17 00:00:00 2001 From: Dominik Eckelmann Date: Sun, 1 Apr 2012 18:31:34 +0200 Subject: added first phpunit test --- _testing/unittests/bootstrap.php | 9 ++++++++ _testing/unittests/inc/common_cleanText.test.php | 28 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 _testing/unittests/bootstrap.php create mode 100644 _testing/unittests/inc/common_cleanText.test.php (limited to '_testing/unittests') diff --git a/_testing/unittests/bootstrap.php b/_testing/unittests/bootstrap.php new file mode 100644 index 000000000..27ca1635e --- /dev/null +++ b/_testing/unittests/bootstrap.php @@ -0,0 +1,9 @@ +assertEquals($unix,cleanText($unix)); + } + + function test_win(){ + $unix = "one\ntwo\nthree"; + $win = "one\r\ntwo\r\nthree"; + + $this->assertEquals(bin2hex($unix), '6f6e650a74776f0a7468726565'); + $this->assertEquals(bin2hex($win), '6f6e650d0a74776f0d0a7468726565'); + $this->assertNotEquals($unix, $win); + $this->assertEquals($unix, cleanText($win)); + } +} + +//Setup VIM: ex: et ts=4 : -- cgit v1.2.3