From: Michael J. Rubinsky Date: Mon, 17 Jan 2011 18:53:50 +0000 (-0500) Subject: use new assertInternalType(), and avoid deprecated warnings. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=93cf4f566e74ad00d1ee3fe393c4e7d0074f867f;p=horde.git use new assertInternalType(), and avoid deprecated warnings. --- diff --git a/framework/Share/test/Horde/Share/Base.php b/framework/Share/test/Horde/Share/Base.php index d5c954835..535e66057 100644 --- a/framework/Share/test/Horde/Share/Base.php +++ b/framework/Share/test/Horde/Share/Base.php @@ -179,7 +179,7 @@ class Horde_Share_Test_Base extends Horde_Test_Case protected function _getShares(array $shares) { $newshares = self::$share->getShares(array($shares[0]->getId(), $shares[1]->getId(), $shares[2]->getId())); - $this->assertType('array', $newshares); + $this->assertInternalType('array', $newshares); $this->assertEquals(3, count($newshares)); $this->assertArrayHasKey('myshare', $newshares); $this->assertArrayHasKey('janeshare', $newshares); @@ -207,7 +207,7 @@ class Horde_Share_Test_Base extends Horde_Test_Case protected function _listAllShares() { $shares = self::$share->listAllShares(); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(5, count($shares)); $this->assertArrayHasKey('myshare', $shares); $this->assertArrayHasKey('systemshare', $shares); @@ -232,7 +232,7 @@ class Horde_Share_Test_Base extends Horde_Test_Case { // Default listing. $shares = self::$share->listShares('john'); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(4, count($shares)); // Test arguments for default listing. @@ -246,7 +246,7 @@ class Horde_Share_Test_Base extends Horde_Test_Case // Shares of a certain owner. $shares = array_values(self::$share->listShares('john', array('attributes' => 'jane', 'sort_by' => 'id'))); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(2, count($shares)); $this->assertEquals($shareids[1], $shares[0]->getId()); $this->assertEquals($shareids[2], $shares[1]->getId()); @@ -254,50 +254,50 @@ class Horde_Share_Test_Base extends Horde_Test_Case // Guest shares. $share = self::$share->getShareById(2); $shares = array_values(self::$share->listShares(false, array('perm' => Horde_Perms::SHOW, 'sort_by' => 'id'))); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(1, count($shares)); $this->assertEquals('System Share', $shares[0]->get('name')); // Shares with certain permissions. $this->assertEquals(4, count(self::$share->listShares('john', array('perm' => Horde_Perms::READ)))); $shares = array_values(self::$share->listShares('john', array('perm' => Horde_Perms::EDIT, 'sort_by' => 'id'))); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(2, count($shares)); $this->assertEquals($shareids[0], $shares[0]->getId()); $this->assertEquals($shareids[1], $shares[1]->getId()); $shares = array_values(self::$share->listShares('john', array('perm' => Horde_Perms::DELETE, 'sort_by' => 'id'))); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(2, count($shares)); $this->assertEquals($shareids[0], $shares[0]->getId()); $this->assertEquals($shareids[2], $shares[1]->getId()); $shares = array_values(self::$share->listShares('john', array('perm' => Horde_Perms::EDIT | Horde_Perms::DELETE))); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(3, count($shares)); $shares = array_values(self::$share->listShares('john', array('perm' => Horde_Perms::ALL))); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(4, count($shares)); // Paging. $shares = array_values(self::$share->listShares('john', array('perm' => Horde_Perms::ALL, 'sort_by' => 'id', 'from' => 2, 'count' => 2))); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(2, count($shares)); $this->assertEquals($shareids[1], $shares[0]->getId()); $this->assertEquals($shareids[2], $shares[1]->getId()); // Sort order and direction. $shares = array_values(self::$share->listShares('john', array('perm' => Horde_Perms::ALL, 'sort_by' => 'id', 'direction' => 1))); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(4, count($shares)); $this->assertEquals($shareids[2], $shares[0]->getId()); $this->assertEquals($shareids[0], $shares[3]->getId()); // Attribute searching. $shares = array_values(self::$share->listShares('john', array('attributes' => array('name' => 'Jane\'s Share')))); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(1, count($shares)); $this->assertEquals($shareids[1], $shares[0]->getId()); $shares = array_values(self::$share->listShares('john', array('attributes' => array('desc' => '行事曆')))); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(1, count($shares)); $this->assertEquals($shareids[0], $shares[0]->getId()); } @@ -317,7 +317,7 @@ class Horde_Share_Test_Base extends Horde_Test_Case public function _listSystemShares() { $shares = self::$share->listSystemShares(); - $this->assertType('array', $shares); + $this->assertInternalType('array', $shares); $this->assertEquals(1, count($shares)); $this->assertArrayHasKey('systemshare', $shares); } diff --git a/framework/Share/test/Horde/Share/Kolab/UnitTest.php b/framework/Share/test/Horde/Share/Kolab/UnitTest.php index 88e012913..249f9fa53 100644 --- a/framework/Share/test/Horde/Share/Kolab/UnitTest.php +++ b/framework/Share/test/Horde/Share/Kolab/UnitTest.php @@ -61,7 +61,7 @@ extends PHPUnit_Framework_TestCase public function testListArray() { - $this->assertType( + $this->assertInternalType( 'array', $this->_getCompleteDriver()->listShares('john') ); @@ -72,7 +72,7 @@ extends PHPUnit_Framework_TestCase $driver = new Horde_Share_Kolab( 'mnemo', 'john', new Horde_Perms(), new Horde_Group_Test() ); - $this->assertType('string', $driver->getType()); + $this->assertInternalType('string', $driver->getType()); } public function testMnemoSupport() diff --git a/framework/Share/test/Horde/Share/SqlHierarchical/Base.php b/framework/Share/test/Horde/Share/SqlHierarchical/Base.php index 88310d9f1..bc3427f67 100644 --- a/framework/Share/test/Horde/Share/SqlHierarchical/Base.php +++ b/framework/Share/test/Horde/Share/SqlHierarchical/Base.php @@ -93,7 +93,7 @@ class Horde_Share_Test_SqlHierarchical_Base extends Horde_Share_Test_Base public function testGetShares(array $shares) { $newshares = self::$share->getShares(array($shares[0]->getId(), $shares[1]->getId(), $shares[2]->getId())); - $this->assertType('array', $newshares); + $this->assertInternalType('array', $newshares); $this->assertEquals(3, count($newshares)); $this->assertInstanceOf('Horde_Share_Object_Sql_Hierarchical', $newshares[0]); $this->assertInstanceOf('Horde_Share_Object_Sql_Hierarchical', $newshares[1]); @@ -106,7 +106,7 @@ class Horde_Share_Test_SqlHierarchical_Base extends Horde_Share_Test_Base self::$share->resetCache(); $newshares = self::$share->getShares(array($shares[0]->getId(), $shares[1]->getId(), $shares[2]->getId())); - $this->assertType('array', $newshares); + $this->assertInternalType('array', $newshares); $this->assertEquals(3, count($newshares)); $this->assertInstanceOf('Horde_Share_Object_Sql_Hierarchical', $newshares[$shares[0]->getId()]); $this->assertInstanceOf('Horde_Share_Object_Sql_Hierarchical', $newshares[$shares[1]->getId()]);