Skip to content

Commit

Permalink
remove unnecessary Zend_Loader::loadClass
Browse files Browse the repository at this point in the history
for zf components. They are not needed since composer autoloader takes care of that. And they were breaking individual test runs e.g. `./vendor/bin/phpunit tests/Zend/Db/Adapter/MysqliTest.php`
  • Loading branch information
falkenhawk committed Dec 6, 2022
1 parent b053ca0 commit a435205
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
2 changes: 1 addition & 1 deletion tests/Zend/Db/Adapter/Db2Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public function testAdapterAlternateStatement()
*/
public function testAdapterZendConfigEmptyDriverOptions()
{
Zend_Loader::loadClass('Zend_Config');
// Zend_Loader::loadClass('Zend_Config');
$params = $this->_util->getParams();
$params['driver_options'] = '';
$params = new Zend_Config($params);
Expand Down
10 changes: 5 additions & 5 deletions tests/Zend/Db/Adapter/TestCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ abstract class Zend_Db_Adapter_TestCommon extends Zend_Db_TestSetup
*/
public function testAdapterZendConfig()
{
Zend_Loader::loadClass('Zend_Config');
// Zend_Loader::loadClass('Zend_Config');
$params = new Zend_Config($this->_util->getParams());

$db = Zend_Db::factory($this->getDriver(), $params);
Expand All @@ -61,7 +61,7 @@ public function testAdapterZendConfig()
*/
public function testAdapterZendConfigEmptyNamespace()
{
Zend_Loader::loadClass('Zend_Config');
// Zend_Loader::loadClass('Zend_Config');
$params = $this->_util->getParams();
$params['adapterNamespace'] = '';
$params = new Zend_Config($params);
Expand All @@ -76,7 +76,7 @@ public function testAdapterZendConfigEmptyNamespace()
*/
public function testAdapterZendConfigEmptyDriverOptions()
{
Zend_Loader::loadClass('Zend_Config');
// Zend_Loader::loadClass('Zend_Config');
$params = $this->_util->getParams();
$params['driver_options'] = '';
$params = new Zend_Config($params);
Expand Down Expand Up @@ -203,8 +203,8 @@ protected function _testAdapterConstructInvalidParam($param, $adapterClass = nul
$params = $this->_util->getParams();
unset($params[$param]);

Zend_Loader::loadClass($adapterClass);
Zend_Loader::loadClass($exceptionClass);
// Zend_Loader::loadClass($adapterClass);
// Zend_Loader::loadClass($exceptionClass);

try {
$db = new $adapterClass($params);
Expand Down
4 changes: 2 additions & 2 deletions tests/Zend/Db/Select/StaticTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function testSelectQuery()
$sql = preg_replace('/\\s+/', ' ', $select->__toString());
$this->assertEquals('SELECT "zfproducts".* FROM "zfproducts"', $sql);
$stmt = $select->query();
Zend_Loader::loadClass('Zend_Db_Statement_Static');
// Zend_Loader::loadClass('Zend_Db_Statement_Static');
$this->assertTrue($stmt instanceof Zend_Db_Statement_Static);
}

Expand All @@ -77,7 +77,7 @@ public function testSelectQueryWithBinds()
$this->assertEquals('SELECT "zfproducts".* FROM "zfproducts" WHERE (product_id = :product_id)', $sql);

$stmt = $select->query();
Zend_Loader::loadClass('Zend_Db_Statement_Static');
// Zend_Loader::loadClass('Zend_Db_Statement_Static');
$this->assertTrue($stmt instanceof Zend_Db_Statement_Static);
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Zend/Db/Table/Select/StaticTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function testSelectQuery()
$sql = preg_replace('/\\s+/', ' ', $select->__toString());
$this->assertEquals('SELECT "zfproducts".* FROM "zfproducts"', $sql);
$stmt = $select->query();
Zend_Loader::loadClass('Zend_Db_Statement_Static');
// Zend_Loader::loadClass('Zend_Db_Statement_Static');
$this->assertTrue($stmt instanceof Zend_Db_Statement_Static);
}

Expand All @@ -78,7 +78,7 @@ public function testSelectQueryWithBinds()
$this->assertEquals('SELECT "zfproducts".* FROM "zfproducts" WHERE (product_id = :product_id)', $sql);

$stmt = $select->query();
Zend_Loader::loadClass('Zend_Db_Statement_Static');
// Zend_Loader::loadClass('Zend_Db_Statement_Static');
$this->assertTrue($stmt instanceof Zend_Db_Statement_Static);
}

Expand Down
22 changes: 11 additions & 11 deletions tests/Zend/Filter/InputTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public function testFilterDeclareByObject()
$data = array(
'month' => '6abc '
);
Zend_Loader::loadClass('Zend_Filter_Digits');
// Zend_Loader::loadClass('Zend_Filter_Digits');
$filters = array(
'month' => array(new Zend_Filter_Digits())
);
Expand Down Expand Up @@ -442,7 +442,7 @@ public function testValidatorDeclareByObject()
$data = array(
'month' => '6'
);
Zend_Loader::loadClass('Zend_Validate_Digits');
// Zend_Loader::loadClass('Zend_Validate_Digits');
$validators = array(
'month' => array(
new Zend_Validate_Digits()
Expand Down Expand Up @@ -498,7 +498,7 @@ public function testValidatorChain()
'field2' => 'abc123',
'field3' => 150,
);
Zend_Loader::loadClass('Zend_Validate_Between');
// Zend_Loader::loadClass('Zend_Validate_Between');
$btw = new Zend_Validate_Between(1, 100);
$validators = array(
'field1' => array('digits', $btw),
Expand Down Expand Up @@ -527,7 +527,7 @@ public function testValidatorInvalidFieldInMultipleRules()
$data = array(
'field2' => 'abc123',
);
Zend_Loader::loadClass('Zend_Validate_Between');
// Zend_Loader::loadClass('Zend_Validate_Between');
$validators = array(
'field2a' => array(
'digits',
Expand Down Expand Up @@ -705,7 +705,7 @@ public function testValidatorBreakChain()
'field2' => '150'
);

Zend_Loader::loadClass('Zend_Validate_Between');
// Zend_Loader::loadClass('Zend_Validate_Between');

$btw1 = new Zend_Validate_Between(1, 100);

Expand Down Expand Up @@ -1047,7 +1047,7 @@ public function testValidatorMessagesMultiple()
$data = array('month' => '13abc');
$digitsMesg = 'Month should consist of digits';
$betweenMesg = 'Month should be between 1 and 12';
Zend_Loader::loadClass('Zend_Validate_Between');
// Zend_Loader::loadClass('Zend_Validate_Between');
$validators = array(
'month' => array(
'digits',
Expand Down Expand Up @@ -1078,7 +1078,7 @@ public function testValidatorMessagesFieldsMultiple()
$data = array('field1' => array('13abc', '234'));
$digitsMesg = 'Field1 should consist of digits';
$betweenMesg = 'Field1 should be between 1 and 12';
Zend_Loader::loadClass('Zend_Validate_Between');
// Zend_Loader::loadClass('Zend_Validate_Between');
$validators = array(
'field1' => array(
'digits',
Expand Down Expand Up @@ -1108,7 +1108,7 @@ public function testValidatorMessagesIntIndex()
{
$data = array('month' => '13abc');
$betweenMesg = 'Month should be between 1 and 12';
Zend_Loader::loadClass('Zend_Validate_Between');
// Zend_Loader::loadClass('Zend_Validate_Between');
$validators = array(
'month' => array(
'digits',
Expand Down Expand Up @@ -1164,7 +1164,7 @@ public function testValidatorMessagesMultipleWithKeys()
$data = array('month' => '13abc');
$digitsMesg = 'Month should consist of digits';
$betweenMesg = 'Month should be between 1 and 12';
Zend_Loader::loadClass('Zend_Validate_Between');
// Zend_Loader::loadClass('Zend_Validate_Between');
$validators = array(
'month' => array(
'digits',
Expand Down Expand Up @@ -1195,7 +1195,7 @@ public function testValidatorMessagesMixedWithKeys()
$data = array('month' => '13abc');
$digitsMesg = 'Month should consist of digits';
$betweenMesg = 'Month should be between 1 and 12';
Zend_Loader::loadClass('Zend_Validate_Between');
// Zend_Loader::loadClass('Zend_Validate_Between');
$validators = array(
'month' => array(
'digits',
Expand Down Expand Up @@ -1582,7 +1582,7 @@ public function testOptionBreakChain()
$data = array(
'field1' => '150'
);
Zend_Loader::loadClass('Zend_Validate_Between');
// Zend_Loader::loadClass('Zend_Validate_Between');
$btw1 = new Zend_Validate_Between(1, 100);
$btw2 = new Zend_Validate_Between(1, 125);
$validators = array(
Expand Down

0 comments on commit a435205

Please sign in to comment.