Skip to content

Commit

Permalink
bumping travis php versions, composer deps (#4)
Browse files Browse the repository at this point in the history
* bumping travis php versions, composer deps

* newer versions of phpunit 7.x do not consider 12.34 and 12.340000 to be "equal"
  • Loading branch information
jaydiablo authored Feb 19, 2019
1 parent 566629c commit 5d564d2
Show file tree
Hide file tree
Showing 18 changed files with 74 additions and 56 deletions.
33 changes: 23 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@ language: php

sudo: false

php:
- 7
- 7.1
- 7.2
- nightly

env: TMPDIR=/tmp USE_XDEBUG=false

branches:
Expand All @@ -16,7 +10,7 @@ branches:

install:
- phpenv rehash
- travis_retry composer install --no-interaction --prefer-source
- travis_retry composer update --no-interaction --prefer-source $COMPOSER_ARGS

stages:
- test
Expand All @@ -35,20 +29,39 @@ script:
jobs:
fast_finish: true
allow_failures:
- php: 7.4snapshot
- php: nightly
include:
- php: 7.1
env: COMPOSER_ARGS="--prefer-lowest"
- php: 7.1
- php: 7.2
env: COMPOSER_ARGS="--prefer-lowest"
- php: 7.2
- php: 7.3
env: COMPOSER_ARGS="--prefer-lowest"
- php: 7.3
- php: 7.4snapshot
env: COMPOSER_ARGS="--ignore-platform-reqs --prefer-lowest"
- php: 7.4snapshot
env: COMPOSER_ARGS="--ignore-platform-reqs"
- php: nightly
env: COMPOSER_ARGS="--ignore-platform-reqs --prefer-lowest"
- php: nightly
env: COMPOSER_ARGS="--ignore-platform-reqs"

- stage: style check
php: 7.1
php: 7.2
env: TMPDIR=/tmp USE_XDEBUG=false
script:
- composer style-check
- stage: phpstan analysis
php: 7.1
php: 7.2
env: TMPDIR=/tmp USE_XDEBUG=false
script:
- composer phpstan
- stage: test with coverage
php: 7.1
php: 7.2
env: TMPDIR=/tmp USE_XDEBUG=true CC_TEST_REPORTER_ID=42d486c369d750a2096422ea0fee5e92328f218dfc6e857d84697ee9b112b01a
before_script:
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
Expand Down
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@
}
],
"require-dev": {
"phpunit/phpunit": "^6.0",
"phpstan/phpstan": "^0.9.2",
"phpunit/phpunit": "^7.0",
"phpstan/phpstan": "^0.11.2",
"jetbrains/phpstorm-stubs": "dev-phpstan",
"friendsofphp/php-cs-fixer": "^2.11",
"maglnet/composer-require-checker": "^0.1.6 | ^0.2.1",
"maglnet/composer-require-checker": "^1.1.0",
"phpro/grumphp": "^0.14.0"
},
"include-path": [
Expand All @@ -59,7 +59,7 @@
"scripts": {
"test": "phpunit",
"test-with-coverage": "phpunit --coverage-clover=clover.xml",
"phpstan": "phpstan analyze -l1 -c phpstan.neon --no-progress ./ --ansi",
"phpstan": "phpstan analyze -c phpstan.neon --no-progress --ansi",
"style-check": "php-cs-fixer fix --dry-run -vv"
},
"suggest": {
Expand Down
1 change: 0 additions & 1 deletion grumphp.yml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ parameters:
allow_risky: true
config: .php_cs
phpstan:
level: 1
configuration: phpstan.neon
phpunit:
metadata:
Expand Down
7 changes: 7 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
parameters:
level: 1
paths:
- ./
excludes_analyse:
- %rootDir%/../../../tests/*
- %rootDir%/../../../vendor/*
Expand All @@ -9,3 +12,7 @@ parameters:
- '#Call to an undefined method Zend_Db_Statement::_bindParam\(\)\.#'
- '#Call to an undefined method Zend_Db_Statement::_execute\(\)\.#'
- '#Variable \$.+ might not be defined\.#'
# __unset's return is not void, it's $this
-
message: '#Result of method Zend_Db_Table_Row_Abstract::__unset\(\) \(void\) is used\.#'
path: %currentWorkingDirectory%/src/Zend/Db/Table/Row/Abstract.php
8 changes: 4 additions & 4 deletions src/Zend/Db/Adapter/Oracle.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,10 @@ protected function _connect()
$connectionFuncName = ($this->_config['persistent'] == true) ? 'oci_pconnect' : 'oci_connect';

$this->_connection = @$connectionFuncName(
$this->_config['username'],
$this->_config['password'],
$this->_config['dbname'],
$this->_config['charset']
$this->_config['username'],
$this->_config['password'],
$this->_config['dbname'],
$this->_config['charset']
);

// check the connection
Expand Down
4 changes: 2 additions & 2 deletions src/Zend/Db/Profiler/Firebug.php
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ protected function updateMessageLabel()
array('%label%',
'%totalCount%',
'%totalDuration%'),
array($this->_label,
array($this->_label,
$this->getTotalNumQueries(),
(string)round($this->_totalElapsedTime, 5)),
$this->_label_template
$this->_label_template
));
}
}
2 changes: 1 addition & 1 deletion src/Zend/Db/Table/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ public function addReference(
$columns,
$refTableClass,
$refColumns,
$onDelete = null,
$onDelete = null,
$onUpdate = null
) {
$reference = array(self::COLUMNS => (array) $columns,
Expand Down
2 changes: 1 addition & 1 deletion src/Zend/Db/Table/Row/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -977,7 +977,7 @@ public function findManyToManyRowset(
$matchTable,
$intersectionTable,
$callerRefRule = null,
$matchRefRule = null,
$matchRefRule = null,
Zend_Db_Table_Select $select = null
) {
$db = $this->_getTable()->getAdapter();
Expand Down
4 changes: 2 additions & 2 deletions tests/Zend/Db/Adapter/Pdo/PgsqlTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ public function testAdapterCharacterVarying()
{
$this->_util->createTable(
'zf_pgsql_charvary',
array('pg_id' => 'character varying(4) NOT NULL',
array('pg_id' => 'character varying(4) NOT NULL',
'pg_info' => "character varying(1) NOT NULL DEFAULT 'A'::character varying")
);
$description = $this->_db->describeTable('zf_pgsql_charvary');
Expand All @@ -213,7 +213,7 @@ public function testAdapterBpchar()
{
$this->_util->createTable(
'zf_pgsql_bpchar',
array('pg_name' => "character(100) DEFAULT 'Default'::bpchar")
array('pg_name' => "character(100) DEFAULT 'Default'::bpchar")
);
$description = $this->_db->describeTable('zf_pgsql_bpchar');
$this->_util->dropTable('zf_pgsql_bpchar');
Expand Down
18 changes: 9 additions & 9 deletions tests/Zend/Db/Adapter/TestCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -1538,54 +1538,54 @@ public function testAdapterQuoteTypeBigInt()
public function testAdapterQuoteTypeFloat()
{
foreach ($this->_numericDataTypes as $typeName => $type) {
if ($type != 2) {
if ($type != Zend_Db::FLOAT_TYPE) {
continue;
}

$value = $this->_db->quote(12.34, $typeName);
$this->assertInternalType('string', $value);
$this->assertEquals(
'12.34',
'12.340000',
$value,
'Incorrect quote() FLOAT_TYPE result'
);

$value = $this->_db->quote('12.34', $typeName);
$this->assertInternalType('string', $value);
$this->assertEquals(
'12.34',
'12.340000',
$value,
'Incorrect quote() FLOAT_TYPE result'
);

$value = $this->_db->quote('+12.34', $typeName);
$this->assertInternalType('string', $value);
$this->assertEquals(
'12.34',
'12.340000',
$value,
'Incorrect quote() FLOAT_TYPE result'
);

$value = $this->_db->quote('-12.34', $typeName);
$this->assertInternalType('string', $value);
$this->assertEquals(
'-12.34',
'-12.340000',
$value,
'Incorrect quote() FLOAT_TYPE result'
);

$value = $this->_db->quote('12.34abcd', $typeName);
$this->assertInternalType('string', $value);
$this->assertEquals(
'12.34',
'12.340000',
$value,
'Incorrect quote() FLOAT_TYPE result'
);

$value = $this->_db->quote('abcd', $typeName);
$this->assertInternalType('string', $value);
$this->assertEquals(
'0',
'0.000000',
$value,
'Incorrect quote() FLOAT_TYPE result'
);
Expand Down Expand Up @@ -1973,8 +1973,8 @@ public function testAdapterUpdateWithLongColumnIdentifier()
//try to update
$this->_db->update(
$tableName,
array('veryveryveryverylongidentifier' => 3),
array($this->_db->quoteIdentifier('id') . ' = 1')
array('veryveryveryverylongidentifier' => 3),
array($this->_db->quoteIdentifier('id') . ' = 1')
);

// check if the row was inserted as expected
Expand Down
6 changes: 3 additions & 3 deletions tests/Zend/Db/Profiler/FirebugTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function setUp()
$this->_profiler = new Zend_Db_Profiler_Firebug();
$this->_db = Zend_Db::factory(
'PDO_SQLITE',
array('dbname' => ':memory:',
array('dbname' => ':memory:',
'profiler' => $this->_profiler)
);
$this->_db->getConnection()->exec('CREATE TABLE foo (
Expand Down Expand Up @@ -109,7 +109,7 @@ public function testEnable()
$this->assertEquals(
substr($messages[Zend_Wildfire_Plugin_FirePhp::STRUCTURE_URI_FIREBUGCONSOLE]
[Zend_Wildfire_Plugin_FirePhp::PLUGIN_URI][0], 0, 55),
'[{"Type":"TABLE","Label":"Zend_Db_Profiler_Firebug (1 @'
'[{"Type":"TABLE","Label":"Zend_Db_Profiler_Firebug (1 @'
);
}

Expand Down Expand Up @@ -146,7 +146,7 @@ public function testCustomLabel()
$this->assertEquals(
substr($messages[Zend_Wildfire_Plugin_FirePhp::STRUCTURE_URI_FIREBUGCONSOLE]
[Zend_Wildfire_Plugin_FirePhp::PLUGIN_URI][0], 0, 38),
'[{"Type":"TABLE","Label":"Label 1 (1 @'
'[{"Type":"TABLE","Label":"Label 1 (1 @'
);
}

Expand Down
10 changes: 5 additions & 5 deletions tests/Zend/Db/Select/StaticTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -872,8 +872,8 @@ public function testIfInColumn()
$select->from('table1', '*');
$select->join(
array('table2'),
'table1.id = table2.id',
array('bar' => 'IF(table2.id IS NOT NULL, 1, 0)')
'table1.id = table2.id',
array('bar' => 'IF(table2.id IS NOT NULL, 1, 0)')
);
$this->assertEquals("SELECT \"table1\".*, IF(table2.id IS NOT NULL, 1, 0) AS \"bar\" FROM \"table1\"\n INNER JOIN \"table2\" ON table1.id = table2.id", $select->assemble());
}
Expand Down Expand Up @@ -1061,7 +1061,7 @@ public function testAssembleQueryWithSubqueryInSelectBlock()
$this->assertEquals(
$expected,
$select->assemble(),
'Assembling query with subquery with join failed'
'Assembling query with subquery with join failed'
);
}

Expand All @@ -1077,7 +1077,7 @@ public function testAssembleQueryWithRawSubqueryInSelectBlock()
$this->assertEquals(
$expected,
$select->assemble(),
'Assembling query with raw subquery with "new line" char failed'
'Assembling query with raw subquery with "new line" char failed'
);
}

Expand All @@ -1092,7 +1092,7 @@ public function testAssembleQueryWithExpressionInSelectBlock()
$this->assertEquals(
$expected,
$select->assemble(),
'Assembling query with raw subquery with "new line" char failed'
'Assembling query with raw subquery with "new line" char failed'
);
}
}
8 changes: 4 additions & 4 deletions tests/Zend/Db/Select/TestCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ public function testSelectColumnsResetBeforeFrom()
} catch (Zend_Exception $e) {
$this->assertTrue(
$e instanceof Zend_Db_Select_Exception,
'Expected exception of type "Zend_Db_Select_Exception", got ' . get_class($e)
'Expected exception of type "Zend_Db_Select_Exception", got ' . get_class($e)
);
$this->assertEquals('No table has been specified for the FROM clause', $e->getMessage());
}
Expand Down Expand Up @@ -636,7 +636,7 @@ public function testSelectMagicMethod()
} catch (Zend_Exception $e) {
$this->assertTrue(
$e instanceof Zend_Db_Select_Exception,
'Expected exception of type "Zend_Db_Select_Exception", got ' . get_class($e)
'Expected exception of type "Zend_Db_Select_Exception", got ' . get_class($e)
);
$this->assertEquals("Unrecognized method 'foo()'", $e->getMessage());
}
Expand Down Expand Up @@ -684,7 +684,7 @@ public function testSelectJoinInnerUsingException()
} catch (Zend_Exception $e) {
$this->assertTrue(
$e instanceof Zend_Db_Select_Exception,
'Expected exception of type "Zend_Db_Select_Exception", got ' . get_class($e)
'Expected exception of type "Zend_Db_Select_Exception", got ' . get_class($e)
);
$this->assertEquals("Unrecognized method 'joinFooUsing()'", $e->getMessage());
}
Expand Down Expand Up @@ -712,7 +712,7 @@ public function testSelectJoinCrossUsing()
} catch (Zend_Exception $e) {
$this->assertTrue(
$e instanceof Zend_Db_Select_Exception,
'Expected exception of type "Zend_Db_Select_Exception", got ' . get_class($e)
'Expected exception of type "Zend_Db_Select_Exception", got ' . get_class($e)
);
$this->assertEquals("Cannot perform a joinUsing with method 'joinCrossUsing()'", $e->getMessage());
}
Expand Down
7 changes: 3 additions & 4 deletions tests/Zend/Db/Table/Relationships/TestCommon.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function testTableRelationshipFindManyToManyRowsetSelect()
$destRows = $originRow1->findManyToManyRowset(
'My_ZendDbTable_TableProducts',
'My_ZendDbTable_TableBugsProducts',
null,
null,
null,
$select
);
Expand Down Expand Up @@ -673,9 +673,8 @@ public function testTableRelationshipCascadingDeleteUsageBasicArray()

$this->assertCount(
0,

$tableBugsCustom->fetchAll(
$tableBugsCustom->getAdapter()
$tableBugsCustom->fetchAll(
$tableBugsCustom->getAdapter()
->quoteInto("$reported_by = ?", 'mmouse')
),
'Expecting cascading delete to have reduced dependent rows to zero'
Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Db/Table/Row/OracleTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function _testTableRowSetReadOnlyGetTableBugs()
{
return $this->_getTable(
'My_ZendDbTable_TableBugs',
array(Zend_Db_Table_Abstract::SEQUENCE => 'zfbugs_seq')
array(Zend_Db_Table_Abstract::SEQUENCE => 'zfbugs_seq')
);
}

Expand Down
2 changes: 1 addition & 1 deletion tests/Zend/Db/Table/Row/Pdo/OciTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function _testTableRowSetReadOnlyGetTableBugs()
{
return $this->_getTable(
'My_ZendDbTable_TableBugs',
array(Zend_Db_Table_Abstract::SEQUENCE => 'zfbugs_seq')
array(Zend_Db_Table_Abstract::SEQUENCE => 'zfbugs_seq')
);
}

Expand Down
Loading

0 comments on commit 5d564d2

Please sign in to comment.