From 59d22b665231db6d82cfd0b1bd855075a7707b70 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 26 Dec 2016 11:05:30 +0100 Subject: [PATCH 1/2] phpunit --- phpunit.xml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 phpunit.xml diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 00000000..666c4a2b --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,8 @@ + + + + + lam/tests + + + \ No newline at end of file From fe4fa15ee75ecd27588fd47ca341954c79a494e2 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 26 Dec 2016 17:40:25 +0100 Subject: [PATCH 2/2] tests --- lam/tests/lib/modules/ppolicyUserTest.php | 8 ++-- lam/tests/lib/typesTest.php | 48 +++++++++++++++++++++++ 2 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 lam/tests/lib/typesTest.php diff --git a/lam/tests/lib/modules/ppolicyUserTest.php b/lam/tests/lib/modules/ppolicyUserTest.php index 71fbd343..e17596b9 100644 --- a/lam/tests/lib/modules/ppolicyUserTest.php +++ b/lam/tests/lib/modules/ppolicyUserTest.php @@ -21,10 +21,10 @@ */ -include_once (dirname ( __FILE__ ) . '/../../../lib/baseModule.inc'); -include_once (dirname ( __FILE__ ) . '/../../../lib/modules.inc'); -include_once (dirname ( __FILE__ ) . '/../../../lib/passwordExpirationJob.inc'); -include_once (dirname ( __FILE__ ) . '/../../../lib/modules/ppolicyUser.inc'); +include_once '../../../lib/baseModule.inc'; +include_once '../../../lib/modules.inc'; +include_once '../../../lib/passwordExpirationJob.inc'; +include_once '../../../lib/modules/ppolicyUser.inc'; /** * Checks the ppolicy expire job. diff --git a/lam/tests/lib/typesTest.php b/lam/tests/lib/typesTest.php new file mode 100644 index 00000000..a0f9c3c4 --- /dev/null +++ b/lam/tests/lib/typesTest.php @@ -0,0 +1,48 @@ +assertEquals('User name', $attr->getAlias()); + $this->assertEquals('uid', $attr->getAttributeName()); + } + + public function testCustomAlias() { + $attr = new \LAM\TYPES\ListAttribute('uid:My translation', 'user'); + $this->assertEquals('My translation', $attr->getAlias()); + $this->assertEquals('uid', $attr->getAttributeName()); + } + +} + +?> \ No newline at end of file