Skip to content

Commit

Permalink
Merge pull request #55 from glensc/drop-older-than-5.3.0-support-tests
Browse files Browse the repository at this point in the history
Drop tests covering php older than 5.3.3
  • Loading branch information
falkenhawk authored Feb 7, 2021
2 parents 809735d + 2d6c0a1 commit ce52a25
Show file tree
Hide file tree
Showing 54 changed files with 71 additions and 841 deletions.
4 changes: 0 additions & 4 deletions tests/Zend/Cache/FunctionFrontendTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,6 @@ public function testCallObjectMethodCorrectCall2()

public function testCallClosureThrowsException()
{
if (version_compare(PHP_VERSION, '5.3', '<')) {
$this->markTestSkipped();
}

$this->setExpectedException('Zend_Cache_Exception');
eval('$closure = function () {};'); // no parse error on php < 5.3
$this->_instance->call($closure);
Expand Down
14 changes: 0 additions & 14 deletions tests/Zend/Config/IniTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -220,20 +220,6 @@ public function testErrorNoSectionFound()

}

public function testZF739()
{
if (version_compare('5.3.0', PHP_VERSION) < 1) {
$this->markTestSkipped('PHP >= 5.3.0 does not allow : as a nest separator');
return;
}

$config = new Zend_Config_Ini($this->_iniFileSeparatorConfig, 'all', array('nestSeparator'=>':'));

$this->assertEquals('all', $config->hostname);
$this->assertEquals('live', $config->db->name);
$this->assertEquals('multi', $config->one->two->three);
}

public function testZF2508NoSections()
{
$config = new Zend_Config_Ini($this->_iniFileNoSectionsConfig);
Expand Down
10 changes: 4 additions & 6 deletions tests/Zend/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,11 @@ public function testLoadSingleSection()

public function testIsset()
{
if (version_compare(PHP_VERSION, '5.1', '>=')) {
$config = new Zend_Config($this->_all, false);
$config = new Zend_Config($this->_all, false);

$this->assertFalse(isset($config->notarealkey));
$this->assertTrue(isset($config->hostname)); // top level
$this->assertTrue(isset($config->db->name)); // one level down
}
$this->assertFalse(isset($config->notarealkey));
$this->assertTrue(isset($config->hostname)); // top level
$this->assertTrue(isset($config->db->name)); // one level down
}

public function testModification()
Expand Down
6 changes: 2 additions & 4 deletions tests/Zend/Controller/Action/Helper/AllTests.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ public static function suite()
$suite->addTestSuite('Zend_Controller_Action_Helper_UrlTest');
$suite->addTestSuite('Zend_Controller_Action_Helper_ViewRendererTest');

if (version_compare(PHP_VERSION, '5.3', '>=')) {
require_once 'Zend/Controller/Action/Helper/NamespaceTest.php';
$suite->addTestSuite('Zend_Controller_Action_Helper_NamespaceTest');
}
require_once 'Zend/Controller/Action/Helper/NamespaceTest.php';
$suite->addTestSuite('Zend_Controller_Action_Helper_NamespaceTest');

return $suite;
}
Expand Down
6 changes: 1 addition & 5 deletions tests/Zend/Controller/Action/Helper/NamespaceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,8 @@ public static function main()
*/
public function testGetNameWithNamespace()
{
if (version_compare(PHP_VERSION, '5.3.0') === -1) {
$this->markTestSkipped('Namespaces not available in PHP < 5.3.0');
}

require_once dirname(__FILE__) . '/../../_files/Helpers/NamespacedHelper.php';

$className = 'MyApp\Controller\Action\Helper\NamespacedHelper';
$helper = new $className;
$this->assertEquals('NamespacedHelper', $helper->getName());
Expand Down
3 changes: 0 additions & 3 deletions tests/Zend/Controller/Action/HelperBrokerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,6 @@ public function testPluginLoaderShouldHaveDefaultPrefixPath()

public function testCanLoadNamespacedHelper()
{
if (version_compare(PHP_VERSION, '5.3.0') === -1) {
$this->markTestSkipped('Namespaces not available in PHP < 5.3.0');
}
$this->front->setControllerDirectory(dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR . '_files')
->setResponse(new Zend_Controller_Response_Cli())
->returnResponse(true);
Expand Down
114 changes: 0 additions & 114 deletions tests/Zend/Db/Select/Pdo/SqliteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,120 +55,6 @@ public function testSelectJoinRight()
$this->markTestSkipped($this->getDriver() . ' does not support RIGHT OUTER JOIN');
}

public function testSelectGroupBy()
{
//SQLite doesn't need different test from 5.3
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
return parent::testSelectGroupBy();
}
$select = $this->_selectGroupBy();
$stmt = $this->_db->query($select);
$result = $stmt->fetchAll();
$bugs_products = $this->_db->quoteIdentifier('zfbugs_products');
$bug_id = $this->_db->quoteIdentifier('bug_id');
$key = "$bugs_products.$bug_id";
$this->assertEquals(3, count($result),
'Expected count of first result set to be 2');
$this->assertEquals(1, $result[0][$key]);
$this->assertEquals(3, $result[0]['thecount'],
'Expected count(*) of first result set to be 2');
$this->assertEquals(2, $result[1][$key]);
$this->assertEquals(1, $result[1]['thecount']);
}

public function testSelectGroupByQualified()
{
//SQLite doesn't need different test from 5.3
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
return parent::testSelectGroupByQualified();
}
$select = $this->_selectGroupByQualified();
$stmt = $this->_db->query($select);
$result = $stmt->fetchAll();
$bugs_products = $this->_db->quoteIdentifier('zfbugs_products');
$bug_id = $this->_db->quoteIdentifier('bug_id');
$key = "$bugs_products.$bug_id";
$this->assertEquals(3, count($result),
'Expected count of first result set to be 2');
$this->assertEquals(1, $result[0][$key]);
$this->assertEquals(3, $result[0]['thecount'],
'Expected count(*) of first result set to be 2');
$this->assertEquals(2, $result[1][$key]);
$this->assertEquals(1, $result[1]['thecount']);
}

public function testSelectHaving()
{
//SQLite doesn't need different test from 5.3
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
return parent::testSelectHaving();
}
$select = $this->_selectHaving();
$stmt = $this->_db->query($select);
$result = $stmt->fetchAll();
$bugs_products = $this->_db->quoteIdentifier('zfbugs_products');
$bug_id = $this->_db->quoteIdentifier('bug_id');
$key = "$bugs_products.$bug_id";
$this->assertEquals(2, count($result));
$this->assertEquals(1, $result[0][$key]);
$this->assertEquals(3, $result[0]['thecount']);
}

public function testSelectHavingWithParameter()
{
//SQLite doesn't need different test from 5.3
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
return parent::testSelectHavingWithParameter();
}
$select = $this->_selectHavingWithParameter();
$stmt = $this->_db->query($select);
$result = $stmt->fetchAll();
$bugs_products = $this->_db->quoteIdentifier('zfbugs_products');
$bug_id = $this->_db->quoteIdentifier('bug_id');
$key = "$bugs_products.$bug_id";
$this->assertEquals(2, count($result));
$this->assertEquals(1, $result[0][$key]);
$this->assertEquals(3, $result[0]['thecount']);
}

public function testSelectHavingOr()
{
//SQLite doesn't need different test from 5.3
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
return parent::testSelectHavingOr();
}
$select = $this->_selectHavingOr();
$stmt = $this->_db->query($select);
$result = $stmt->fetchAll();
$bugs_products = $this->_db->quoteIdentifier('zfbugs_products');
$bug_id = $this->_db->quoteIdentifier('bug_id');
$key = "$bugs_products.$bug_id";
$this->assertEquals(3, count($result));
$this->assertEquals(1, $result[0][$key]);
$this->assertEquals(3, $result[0]['thecount']);
$this->assertEquals(2, $result[1][$key]);
$this->assertEquals(1, $result[1]['thecount']);
}

public function testSelectHavingOrWithParameter()
{
//SQLite doesn't need different test from 5.3
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
return parent::testSelectHavingOrWithParameter();
}
$select = $this->_selectHavingOrWithParameter();
$stmt = $this->_db->query($select);
$result = $stmt->fetchAll();
$bugs_products = $this->_db->quoteIdentifier('zfbugs_products');
$bug_id = $this->_db->quoteIdentifier('bug_id');
$key = "$bugs_products.$bug_id";
$this->assertEquals(3, count($result));
$this->assertEquals(1, $result[0][$key]);
$this->assertEquals(3, $result[0]['thecount']);
$this->assertEquals(2, $result[1][$key]);
$this->assertEquals(1, $result[1]['thecount']);
}

public function getDriver()
{
return 'Pdo_Sqlite';
Expand Down
3 changes: 0 additions & 3 deletions tests/Zend/Db/Select/StaticTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -794,9 +794,6 @@ public function testSelectOrderByMultiplePositions()
*/
public function testPhp53Assembly()
{
if (version_compare(PHP_VERSION, 5.3) == -1 ) {
$this->markTestSkipped('This test needs at least PHP 5.3');
}
$select = $this->_db->select();
$select->from('table1', '*');
$select->joinLeft(array('table2'), 'table1.id=table2.id');
Expand Down
3 changes: 0 additions & 3 deletions tests/Zend/Db/Statement/TestCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,6 @@ public function testStatementGetColumnMeta()
$meta = $stmt->getColumnMeta($i);
$this->assertTrue(is_array($meta));
foreach ($this->_getColumnMetaKeys as $key) {
if ($key == 'table' && version_compare(PHP_VERSION, '5.2.0', '<')) {
continue;
}
$this->assertContains($key, array_keys($meta));
}
}
Expand Down
114 changes: 0 additions & 114 deletions tests/Zend/Db/Table/Select/Pdo/SqliteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,120 +59,6 @@ public function testSelectJoinRight()
$this->markTestSkipped($this->getDriver() . ' does not support RIGHT OUTER JOIN');
}

public function testSelectGroupBy()
{
//SQLite doesn't need different test from 5.3
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
return parent::testSelectGroupBy();
}
$select = $this->_selectGroupBy();
$stmt = $this->_db->query($select);
$result = $stmt->fetchAll();
$bugs_products = $this->_db->quoteIdentifier('zfbugs_products');
$bug_id = $this->_db->quoteIdentifier('bug_id');
$key = "$bugs_products.$bug_id";
$this->assertEquals(3, count($result),
'Expected count of first result set to be 2');
$this->assertEquals(1, $result[0][$key]);
$this->assertEquals(3, $result[0]['thecount'],
'Expected count(*) of first result set to be 2');
$this->assertEquals(2, $result[1][$key]);
$this->assertEquals(1, $result[1]['thecount']);
}

public function testSelectGroupByQualified()
{
//SQLite doesn't need different test from 5.3
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
return parent::testSelectGroupByQualified();
}
$select = $this->_selectGroupByQualified();
$stmt = $this->_db->query($select);
$result = $stmt->fetchAll();
$bugs_products = $this->_db->quoteIdentifier('zfbugs_products');
$bug_id = $this->_db->quoteIdentifier('bug_id');
$key = "$bugs_products.$bug_id";
$this->assertEquals(3, count($result),
'Expected count of first result set to be 2');
$this->assertEquals(1, $result[0][$key]);
$this->assertEquals(3, $result[0]['thecount'],
'Expected count(*) of first result set to be 2');
$this->assertEquals(2, $result[1][$key]);
$this->assertEquals(1, $result[1]['thecount']);
}

public function testSelectHaving()
{
//SQLite doesn't need different test from 5.3
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
return parent::testSelectHaving();
}
$select = $this->_selectHaving();
$stmt = $this->_db->query($select);
$result = $stmt->fetchAll();
$bugs_products = $this->_db->quoteIdentifier('zfbugs_products');
$bug_id = $this->_db->quoteIdentifier('bug_id');
$key = "$bugs_products.$bug_id";
$this->assertEquals(2, count($result));
$this->assertEquals(1, $result[0][$key]);
$this->assertEquals(3, $result[0]['thecount']);
}

public function testSelectHavingWithParameter()
{
//SQLite doesn't need different test from 5.3
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
return parent::testSelectHavingWithParameter();
}
$select = $this->_selectHavingWithParameter();
$stmt = $this->_db->query($select);
$result = $stmt->fetchAll();
$bugs_products = $this->_db->quoteIdentifier('zfbugs_products');
$bug_id = $this->_db->quoteIdentifier('bug_id');
$key = "$bugs_products.$bug_id";
$this->assertEquals(2, count($result));
$this->assertEquals(1, $result[0][$key]);
$this->assertEquals(3, $result[0]['thecount']);
}

public function testSelectHavingOr()
{
//SQLite doesn't need different test from 5.3
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
return parent::testSelectHavingOr();
}
$select = $this->_selectHavingOr();
$stmt = $this->_db->query($select);
$result = $stmt->fetchAll();
$bugs_products = $this->_db->quoteIdentifier('zfbugs_products');
$bug_id = $this->_db->quoteIdentifier('bug_id');
$key = "$bugs_products.$bug_id";
$this->assertEquals(3, count($result));
$this->assertEquals(1, $result[0][$key]);
$this->assertEquals(3, $result[0]['thecount']);
$this->assertEquals(2, $result[1][$key]);
$this->assertEquals(1, $result[1]['thecount']);
}

public function testSelectHavingOrWithParameter()
{
//SQLite doesn't need different test from 5.3
if (version_compare(PHP_VERSION, '5.3.0', '>=')) {
return parent::testSelectHavingOrWithParameter();
}
$select = $this->_selectHavingOrWithParameter();
$stmt = $this->_db->query($select);
$result = $stmt->fetchAll();
$bugs_products = $this->_db->quoteIdentifier('zfbugs_products');
$bug_id = $this->_db->quoteIdentifier('bug_id');
$key = "$bugs_products.$bug_id";
$this->assertEquals(3, count($result));
$this->assertEquals(1, $result[0][$key]);
$this->assertEquals(3, $result[0]['thecount']);
$this->assertEquals(2, $result[1][$key]);
$this->assertEquals(1, $result[1]['thecount']);
}

public function getDriver()
{
return 'Pdo_Sqlite';
Expand Down
3 changes: 0 additions & 3 deletions tests/Zend/EventManager/EventManagerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,6 @@ public function testTriggerCanTakeAnOptionalCallbackArgumentToEmulateTriggerUnti

public function testWeakRefsAreHonoredWhenTriggering()
{
if (version_compare(PHP_VERSION, '5.3.0', '<')) {
$this->markTestSkipped('Requires PHP >= 5.3.0 as it tests functors');
}
if (!class_exists('WeakRef', false)) {
$this->markTestSkipped('Requires pecl/weakref');
}
Expand Down
Loading

0 comments on commit ce52a25

Please sign in to comment.