Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Fix PHPUnit 3.6 deprecation errors
Browse files Browse the repository at this point in the history
  • Loading branch information
postalservice14 committed Aug 17, 2011
13 parents 14733fb + 9522bf5 + 13eba34 + 80e576a + edc16b1 + 9113d7c + 2510b05 + 1f7f769 + 37761a1 + 6e8b2c3 + e4ea566 + 0b2466c + 46af398 commit e65e38f
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 49 deletions.
28 changes: 14 additions & 14 deletions test/AttributeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public function testGetNonExistentAttribute()
$value=Ldap\Attribute::getAttribute($data, 'uid2', 0);
$this->assertNull($value);
$array=Ldap\Attribute::getAttribute($data, 'uid2');
$this->assertType('array', $array);
$this->assertInternalType('array', $array);
$this->assertEquals(0, count($array));
}

Expand All @@ -84,7 +84,7 @@ public function testGetAttributeArray()
{
$data=array('uid' => array('value'));
$value=Ldap\Attribute::getAttribute($data, 'uid');
$this->assertType('array', $value);
$this->assertInternalType('array', $value);
$this->assertEquals(1, count($value));
$this->assertContains('value', $value);
}
Expand All @@ -94,7 +94,7 @@ public function testSimpleSetAttribute()
$data=array();
Ldap\Attribute::setAttribute($data, 'uid', 'new', false);
$this->assertArrayHasKey('uid', $data);
$this->assertType('array', $data['uid']);
$this->assertInternalType('array', $data['uid']);
$this->assertEquals(1, count($data['uid']));
$this->assertContains('new', $data['uid']);
}
Expand All @@ -104,7 +104,7 @@ public function testSimpleOverwriteAttribute()
$data=array('uid' => array('old'));
Ldap\Attribute::setAttribute($data, 'uid', 'new', false);
$this->assertArrayHasKey('uid', $data);
$this->assertType('array', $data['uid']);
$this->assertInternalType('array', $data['uid']);
$this->assertEquals(1, count($data['uid']));
$this->assertContains('new', $data['uid']);
}
Expand All @@ -114,7 +114,7 @@ public function testSimpleAppendAttribute()
$data=array('uid' => array('old'));
Ldap\Attribute::setAttribute($data, 'uid', 'new', true);
$this->assertArrayHasKey('uid', $data);
$this->assertType('array', $data['uid']);
$this->assertInternalType('array', $data['uid']);
$this->assertEquals(2, count($data['uid']));
$this->assertContains('old', $data['uid']);
$this->assertContains('new', $data['uid']);
Expand All @@ -141,7 +141,7 @@ public function testArraySetAttribute()
$data=array();
Ldap\Attribute::setAttribute($data, 'uid', array('new1', 'new2'), false);
$this->assertArrayHasKey('uid', $data);
$this->assertType('array', $data['uid']);
$this->assertInternalType('array', $data['uid']);
$this->assertEquals(2, count($data['uid']));
$this->assertContains('new1', $data['uid']);
$this->assertContains('new2', $data['uid']);
Expand All @@ -154,7 +154,7 @@ public function testArrayOverwriteAttribute()
$data=array('uid' => array('old'));
Ldap\Attribute::setAttribute($data, 'uid', array('new1', 'new2'), false);
$this->assertArrayHasKey('uid', $data);
$this->assertType('array', $data['uid']);
$this->assertInternalType('array', $data['uid']);
$this->assertEquals(2, count($data['uid']));
$this->assertContains('new1', $data['uid']);
$this->assertContains('new2', $data['uid']);
Expand All @@ -167,7 +167,7 @@ public function testArrayAppendAttribute()
$data=array('uid' => array('old'));
Ldap\Attribute::setAttribute($data, 'uid', array('new1', 'new2'), true);
$this->assertArrayHasKey('uid', $data);
$this->assertType('array', $data['uid']);
$this->assertInternalType('array', $data['uid']);
$this->assertEquals(3, count($data['uid']));
$this->assertContains('old', $data['uid']);
$this->assertContains('new1', $data['uid']);
Expand Down Expand Up @@ -327,7 +327,7 @@ public function testRemoveAttributeValueSimple()
$data=array('test' => array('value1', 'value2', 'value3', 'value3'));
Ldap\Attribute::removeFromAttribute($data, 'test', 'value2');
$this->assertArrayHasKey('test', $data);
$this->assertType('array', $data['test']);
$this->assertInternalType('array', $data['test']);
$this->assertEquals(3, count($data['test']));
$this->assertContains('value1', $data['test']);
$this->assertContains('value3', $data['test']);
Expand All @@ -339,7 +339,7 @@ public function testRemoveAttributeValueArray()
$data=array('test' => array('value1', 'value2', 'value3', 'value3'));
Ldap\Attribute::removeFromAttribute($data, 'test', array('value1', 'value2'));
$this->assertArrayHasKey('test', $data);
$this->assertType('array', $data['test']);
$this->assertInternalType('array', $data['test']);
$this->assertEquals(2, count($data['test']));
$this->assertContains('value3', $data['test']);
$this->assertNotContains('value1', $data['test']);
Expand All @@ -351,7 +351,7 @@ public function testRemoveAttributeMultipleValueSimple()
$data=array('test' => array('value1', 'value2', 'value3', 'value3'));
Ldap\Attribute::removeFromAttribute($data, 'test', 'value3');
$this->assertArrayHasKey('test', $data);
$this->assertType('array', $data['test']);
$this->assertInternalType('array', $data['test']);
$this->assertEquals(2, count($data['test']));
$this->assertContains('value1', $data['test']);
$this->assertContains('value2', $data['test']);
Expand All @@ -363,7 +363,7 @@ public function testRemoveAttributeMultipleValueArray()
$data=array('test' => array('value1', 'value2', 'value3', 'value3'));
Ldap\Attribute::removeFromAttribute($data, 'test', array('value1', 'value3'));
$this->assertArrayHasKey('test', $data);
$this->assertType('array', $data['test']);
$this->assertInternalType('array', $data['test']);
$this->assertEquals(1, count($data['test']));
$this->assertContains('value2', $data['test']);
$this->assertNotContains('value1', $data['test']);
Expand All @@ -375,7 +375,7 @@ public function testRemoveAttributeValueBoolean()
$data=array('test' => array('TRUE', 'FALSE', 'TRUE', 'FALSE'));
Ldap\Attribute::removeFromAttribute($data, 'test', false);
$this->assertArrayHasKey('test', $data);
$this->assertType('array', $data['test']);
$this->assertInternalType('array', $data['test']);
$this->assertEquals(2, count($data['test']));
$this->assertContains('TRUE', $data['test']);
$this->assertNotContains('FALSE', $data['test']);
Expand All @@ -386,7 +386,7 @@ public function testRemoveAttributeValueInteger()
$data=array('test' => array('1', '2', '3', '4'));
Ldap\Attribute::removeFromAttribute($data, 'test', array(2, 4));
$this->assertArrayHasKey('test', $data);
$this->assertType('array', $data['test']);
$this->assertInternalType('array', $data['test']);
$this->assertEquals(2, count($data['test']));
$this->assertContains('1', $data['test']);
$this->assertContains('3', $data['test']);
Expand Down
2 changes: 1 addition & 1 deletion test/Node/OfflineTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ public function testIllegalAttributeAccessDnSet()
public function testAttributeAccessDnGet()
{
$node=$this->_createTestNode();
$this->assertType('string', $node->dn);
$this->assertInternalType('string', $node->dn);
$this->assertEquals($node->getDn()->toString(), $node->dn);
}

Expand Down
52 changes: 26 additions & 26 deletions test/Node/RootDseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,38 +94,38 @@ public function testGetters()
{
$root=$this->_getLDAP()->getRootDse();

$this->assertType('array', $root->getNamingContexts());
$this->assertType('string', $root->getSubschemaSubentry());
$this->assertInternalType('array', $root->getNamingContexts());
$this->assertInternalType('string', $root->getSubschemaSubentry());

switch ($root->getServerType()) {
case RootDse::SERVER_TYPE_ACTIVEDIRECTORY:
$this->assertType('string', $root->getConfigurationNamingContext());
$this->assertType('string', $root->getCurrentTime());
$this->assertType('string', $root->getDefaultNamingContext());
$this->assertType('string', $root->getDnsHostName());
$this->assertType('string', $root->getDomainControllerFunctionality());
$this->assertType('string', $root->getDomainFunctionality());
$this->assertType('string', $root->getDsServiceName());
$this->assertType('string', $root->getForestFunctionality());
$this->assertType('string', $root->getHighestCommittedUSN());
$this->assertInternalType('string', $root->getConfigurationNamingContext());
$this->assertInternalType('string', $root->getCurrentTime());
$this->assertInternalType('string', $root->getDefaultNamingContext());
$this->assertInternalType('string', $root->getDnsHostName());
$this->assertInternalType('string', $root->getDomainControllerFunctionality());
$this->assertInternalType('string', $root->getDomainFunctionality());
$this->assertInternalType('string', $root->getDsServiceName());
$this->assertInternalType('string', $root->getForestFunctionality());
$this->assertInternalType('string', $root->getHighestCommittedUSN());
$this->assertType('boolean', $root->getIsGlobalCatalogReady());
$this->assertType('boolean', $root->getIsSynchronized());
$this->assertType('string', $root->getLDAPServiceName());
$this->assertType('string', $root->getRootDomainNamingContext());
$this->assertType('string', $root->getSchemaNamingContext());
$this->assertType('string', $root->getServerName());
$this->assertInternalType('string', $root->getLDAPServiceName());
$this->assertInternalType('string', $root->getRootDomainNamingContext());
$this->assertInternalType('string', $root->getSchemaNamingContext());
$this->assertInternalType('string', $root->getServerName());
break;
case RootDse::SERVER_TYPE_EDIRECTORY:
$this->assertType('string', $root->getVendorName());
$this->assertType('string', $root->getVendorVersion());
$this->assertType('string', $root->getDsaName());
$this->assertType('string', $root->getStatisticsErrors());
$this->assertType('string', $root->getStatisticsSecurityErrors());
$this->assertType('string', $root->getStatisticsChainings());
$this->assertType('string', $root->getStatisticsReferralsReturned());
$this->assertType('string', $root->getStatisticsExtendedOps());
$this->assertType('string', $root->getStatisticsAbandonOps());
$this->assertType('string', $root->getStatisticsWholeSubtreeSearchOps());
$this->assertInternalType('string', $root->getVendorName());
$this->assertInternalType('string', $root->getVendorVersion());
$this->assertInternalType('string', $root->getDsaName());
$this->assertInternalType('string', $root->getStatisticsErrors());
$this->assertInternalType('string', $root->getStatisticsSecurityErrors());
$this->assertInternalType('string', $root->getStatisticsChainings());
$this->assertInternalType('string', $root->getStatisticsReferralsReturned());
$this->assertInternalType('string', $root->getStatisticsExtendedOps());
$this->assertInternalType('string', $root->getStatisticsAbandonOps());
$this->assertInternalType('string', $root->getStatisticsWholeSubtreeSearchOps());
break;
case RootDse::SERVER_TYPE_OPENLDAP:
$this->_assertNullOrString($root->getConfigContext());
Expand All @@ -139,7 +139,7 @@ protected function _assertNullOrString($value)
if ($value===null) {
$this->assertNull($value);
} else {
$this->assertType('string', $value);
$this->assertInternalType('string', $value);
}
}

Expand Down
10 changes: 5 additions & 5 deletions test/Node/SchemaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,18 @@ public function testSchemaNode()

public function testGetters()
{
$this->assertType('array', $this->_schema->getAttributeTypes());
$this->assertType('array', $this->_schema->getObjectClasses());
$this->assertInternalType('array', $this->_schema->getAttributeTypes());
$this->assertInternalType('array', $this->_schema->getObjectClasses());

switch ($this->_getLDAP()->getRootDse()->getServerType()) {
case RootDse::SERVER_TYPE_ACTIVEDIRECTORY:
break;
case RootDse::SERVER_TYPE_EDIRECTORY:
break;
case RootDse::SERVER_TYPE_OPENLDAP:
$this->assertType('array', $this->_schema->getLDAPSyntaxes());
$this->assertType('array', $this->_schema->getMatchingRules());
$this->assertType('array', $this->_schema->getMatchingRuleUse());
$this->assertInternalType('array', $this->_schema->getLDAPSyntaxes());
$this->assertInternalType('array', $this->_schema->getMatchingRules());
$this->assertInternalType('array', $this->_schema->getMatchingRuleUse());
break;
}
}
Expand Down
6 changes: 3 additions & 3 deletions test/SearchTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ public function testCallingCurrentOnIteratorReturnsFirstElement()
TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, Ldap\Ldap::SEARCH_SCOPE_SUB);
$this->assertEquals(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, $items->getInnerIterator()->key());
$current = $items->getInnerIterator()->current();
$this->assertType('array', $current);
$this->assertInternalType('array', $current);
$this->assertEquals(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, $current['dn']);
}

Expand All @@ -468,7 +468,7 @@ public function testCallingCurrentOnCollectionReturnsFirstElement()
$this->assertEquals(0, $items->key());
$this->assertEquals(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, $items->dn());
$current = $items->current();
$this->assertType('array', $current);
$this->assertInternalType('array', $current);
$this->assertEquals(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, $current['dn']);
}

Expand Down Expand Up @@ -505,7 +505,7 @@ public function testResultIterationAfterCallingCurrent()
$this->assertEquals(9, $items->count());
$this->assertEquals(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, $items->getInnerIterator()->key());
$current = $items->current();
$this->assertType('array', $current);
$this->assertInternalType('array', $current);
$this->assertEquals(TESTS_ZEND_LDAP_WRITEABLE_SUBTREE, $current['dn']);

$i=0;
Expand Down

0 comments on commit e65e38f

Please sign in to comment.