use new assertInternalType(), and avoid deprecated warnings.
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 17 Jan 2011 18:53:50 +0000 (13:53 -0500)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 17 Jan 2011 18:53:50 +0000 (13:53 -0500)
framework/Share/test/Horde/Share/Base.php
framework/Share/test/Horde/Share/Kolab/UnitTest.php
framework/Share/test/Horde/Share/SqlHierarchical/Base.php

index d5c9548..535e660 100644 (file)
@@ -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);
     }
index 88e0129..249f9fa 100644 (file)
@@ -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()
index 88310d9..bc3427f 100644 (file)
@@ -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()]);