From 58e15da1a856809715b695d320a2b838625ed2a1 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 28 Nov 2019 21:18:25 +0100 Subject: [PATCH] updated test cases --- lam/tests/lib/3rdParty/pla/functionsTest.php | 5 ++-- lam/tests/lib/LAMConfigTest.php | 4 +-- lam/tests/lib/accountTest.php | 3 ++- lam/tests/lib/baseModuleTest.php | 3 ++- lam/tests/lib/importTest.php | 25 ++++++++++--------- lam/tests/lib/modules/bindDLZTest.php | 5 ++-- lam/tests/lib/modules/customFieldsTest.php | 5 ++-- lam/tests/lib/modules/ppolicyUserTest.php | 5 ++-- lam/tests/lib/modules/sambaSamAccountTest.php | 6 ++--- lam/tests/lib/modules/shadowAccountTest.php | 7 +++--- lam/tests/lib/modules/sudoRoleTest.php | 6 ++--- lam/tests/lib/modules/windowsUserTest.php | 6 ++--- lam/tests/lib/pdfstructTest.php | 3 ++- lam/tests/lib/securityTest.php | 4 +-- lam/tests/lib/selfServiceTest.php | 3 ++- lam/tests/lib/typesTest.php | 6 ++--- 16 files changed, 53 insertions(+), 43 deletions(-) diff --git a/lam/tests/lib/3rdParty/pla/functionsTest.php b/lam/tests/lib/3rdParty/pla/functionsTest.php index dbc95c61..28405370 100644 --- a/lam/tests/lib/3rdParty/pla/functionsTest.php +++ b/lam/tests/lib/3rdParty/pla/functionsTest.php @@ -1,8 +1,9 @@ setExpectedException(LAMException::class, 'this is no LDIF'); + $this->expectException(LAMException::class, 'this is no LDIF'); $importer = new Importer(); $importer->getTasks($lines); @@ -59,7 +60,7 @@ class ImporterTest extends PHPUnit_Framework_TestCase { "version: 3" ); - $this->setExpectedException(LAMException::class, 'version: 3'); + $this->expectException(LAMException::class, 'version: 3'); $importer = new Importer(); $importer->getTasks($lines); @@ -75,7 +76,7 @@ class ImporterTest extends PHPUnit_Framework_TestCase { "version: 1" ); - $this->setExpectedException(LAMException::class); + $this->expectException(LAMException::class); $importer = new Importer(); $importer->getTasks($lines); @@ -90,7 +91,7 @@ class ImporterTest extends PHPUnit_Framework_TestCase { "some: data" ); - $this->setExpectedException(LAMException::class); + $this->expectException(LAMException::class); $importer = new Importer(); $importer->getTasks($lines); @@ -106,7 +107,7 @@ class ImporterTest extends PHPUnit_Framework_TestCase { "dn: uid=test,dc=example,dc=com" ); - $this->setExpectedException(LAMException::class, 'dn: uid=test,dc=example,dc=com'); + $this->expectException(LAMException::class, 'dn: uid=test,dc=example,dc=com'); $importer = new Importer(); $importer->getTasks($lines); @@ -141,7 +142,7 @@ class ImporterTest extends PHPUnit_Framework_TestCase { "uid: test", ); - $this->setExpectedException(LAMException::class, 'uid=test,dc=example,dc=com - changeType: invalid'); + $this->expectException(LAMException::class, 'uid=test,dc=example,dc=com - changeType: invalid'); $importer = new Importer(); $tasks = $importer->getTasks($lines); @@ -178,7 +179,7 @@ class ImporterTest extends PHPUnit_Framework_TestCase { "uid: test", ); - $this->setExpectedException(LAMException::class, 'uid=test,dc=example,dc=com'); + $this->expectException(LAMException::class, 'uid=test,dc=example,dc=com'); $importer = new Importer(); $tasks = $importer->getTasks($lines); @@ -197,7 +198,7 @@ class ImporterTest extends PHPUnit_Framework_TestCase { "deleteoldrdn: x", ); - $this->setExpectedException(LAMException::class, 'uid=test,dc=example,dc=com'); + $this->expectException(LAMException::class, 'uid=test,dc=example,dc=com'); $importer = new Importer(); $tasks = $importer->getTasks($lines); @@ -235,7 +236,7 @@ class ImporterTest extends PHPUnit_Framework_TestCase { "uid: test", ); - $this->setExpectedException(LAMException::class, 'uid=test,dc=example,dc=com'); + $this->expectException(LAMException::class, 'uid=test,dc=example,dc=com'); $importer = new Importer(); $tasks = $importer->getTasks($lines); @@ -271,7 +272,7 @@ class ImporterTest extends PHPUnit_Framework_TestCase { "invalid: test", ); - $this->setExpectedException(LAMException::class, 'uid=test,dc=example,dc=com'); + $this->expectException(LAMException::class, 'uid=test,dc=example,dc=com'); $importer = new Importer(); $tasks = $importer->getTasks($lines); @@ -291,7 +292,7 @@ class ImporterTest extends PHPUnit_Framework_TestCase { "invalid: uid2" ); - $this->setExpectedException(LAMException::class, 'uid=test,dc=example,dc=com'); + $this->expectException(LAMException::class, 'uid=test,dc=example,dc=com'); $importer = new Importer(); $tasks = $importer->getTasks($lines); diff --git a/lam/tests/lib/modules/bindDLZTest.php b/lam/tests/lib/modules/bindDLZTest.php index c9dfb8a6..81e5f7be 100644 --- a/lam/tests/lib/modules/bindDLZTest.php +++ b/lam/tests/lib/modules/bindDLZTest.php @@ -1,7 +1,8 @@ assertEquals('1', bindDLZ::increaseSerial('')); diff --git a/lam/tests/lib/modules/customFieldsTest.php b/lam/tests/lib/modules/customFieldsTest.php index 108b217b..0932cd91 100644 --- a/lam/tests/lib/modules/customFieldsTest.php +++ b/lam/tests/lib/modules/customFieldsTest.php @@ -1,7 +1,8 @@ assertFalse(sambaSamAccount::validateHistoryEntry("password", "")); diff --git a/lam/tests/lib/modules/shadowAccountTest.php b/lam/tests/lib/modules/shadowAccountTest.php index bcf49312..2fb8b13c 100644 --- a/lam/tests/lib/modules/shadowAccountTest.php +++ b/lam/tests/lib/modules/shadowAccountTest.php @@ -1,8 +1,9 @@ array('shadowAccount')); @@ -122,7 +123,7 @@ if (is_readable('lam/lib/passwordExpirationJob.inc')) { * @author Roland Gruber * */ - class ShadowAccountPasswordNotifyJobTest extends PHPUnit_Framework_TestCase { + class ShadowAccountPasswordNotifyJobTest extends TestCase { private $job; diff --git a/lam/tests/lib/modules/sudoRoleTest.php b/lam/tests/lib/modules/sudoRoleTest.php index 56630701..e81ffb96 100644 --- a/lam/tests/lib/modules/sudoRoleTest.php +++ b/lam/tests/lib/modules/sudoRoleTest.php @@ -1,9 +1,9 @@ array('user')); diff --git a/lam/tests/lib/pdfstructTest.php b/lam/tests/lib/pdfstructTest.php index 7e206065..bf0ba93d 100644 --- a/lam/tests/lib/pdfstructTest.php +++ b/lam/tests/lib/pdfstructTest.php @@ -4,6 +4,7 @@ use LAM\PDF\PDFEntrySection; use LAM\PDF\PDFStructureReader; use LAM\PDF\PDFStructure; use LAM\PDF\PDFStructureWriter; +use PHPUnit\Framework\TestCase; /* This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/) @@ -33,7 +34,7 @@ include_once 'lam/lib/pdfstruct.inc'; * @author Roland Gruber * */ -class ReadStructureTest extends PHPUnit_Framework_TestCase { +class ReadStructureTest extends TestCase { /** * Reads the sample structure. diff --git a/lam/tests/lib/securityTest.php b/lam/tests/lib/securityTest.php index 9fcf4e38..2a5cf4a1 100644 --- a/lam/tests/lib/securityTest.php +++ b/lam/tests/lib/securityTest.php @@ -1,6 +1,6 @@