Skip to content

Commit ad2d4f4

Browse files
authored
Merge pull request #1825 from Slamdunk/patch-1
Tests: remove manual env checks, update PHPUnit
2 parents 1709572 + 69e1fe1 commit ad2d4f4

27 files changed

+71
-41
lines changed

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ matrix:
1212
- php: 7.1
1313
- php: 7.2
1414

15+
cache:
16+
directories:
17+
- $HOME/.composer/cache
18+
1519
services: mongodb
1620

1721
before_install:

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"doctrine/orm": ">=2.5.0",
4848
"doctrine/common": ">=2.5.0",
4949
"symfony/yaml": "~2.6|~3.0|~4.0",
50-
"phpunit/phpunit": "*"
50+
"phpunit/phpunit": "^4.8|^5.7|^6.5"
5151
},
5252
"suggest": {
5353
"doctrine/mongodb-odm": "to use the extensions with the MongoDB ODM",

composer7.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@
4747
},
4848
"require-dev": {
4949
"alcaeus/mongo-php-adapter": "~1.0.4",
50-
"doctrine/mongodb-odm": "~1.0",
50+
"doctrine/mongodb-odm": ">=1.0.2",
5151
"doctrine/orm": ">=2.5.0",
5252
"doctrine/common": ">=2.5.0",
53-
"symfony/yaml": "~2.6|~3.0",
54-
"phpunit/phpunit": "*"
53+
"symfony/yaml": "~2.6|~3.0|~4.0",
54+
"phpunit/phpunit": "^4.8|^5.7|^6.5"
5555
},
5656
"suggest": {
5757
"doctrine/mongodb-odm": "to use the extensions with the MongoDB ODM",

lib/Gedmo/Tool/Logging/DBAL/QueryAnalyzer.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,15 +180,15 @@ public function getExecutionTimes()
180180
/**
181181
* Create the SQL with mapped parameters
182182
*
183-
* @param string $sql
184-
* @param array $params
185-
* @param array $types
183+
* @param string $sql
184+
* @param null|array $params
185+
* @param null|array $types
186186
*
187187
* @return string
188188
*/
189189
private function generateSql($sql, $params, $types)
190190
{
191-
if (!count($params)) {
191+
if (null === $params || !count($params)) {
192192
return $sql;
193193
}
194194
$converted = $this->getConvertedParams($params, $types);

tests/Gedmo/IpTraceable/IpTraceableTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function testInvalidIpShouldThrowInvalidArgumentException()
4040
{
4141
$listener = new IpTraceableListener();
4242

43-
$this->setExpectedException('Gedmo\Exception\InvalidArgumentException');
43+
$this->expectException('Gedmo\Exception\InvalidArgumentException');
4444

4545
$listener->setIpValue('xx.xxx.xx.xxx');
4646
}

tests/Gedmo/Mapping/LoggableMappingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* @link http://www.gediminasm.org
1515
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
1616
*/
17-
class LoggableMappingTest extends \PHPUnit_Framework_TestCase
17+
class LoggableMappingTest extends \PHPUnit\Framework\TestCase
1818
{
1919
const YAML_CATEGORY = 'Mapping\Fixture\Yaml\Category';
2020
private $em;

tests/Gedmo/Mapping/MappingEventAdapterTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
use Doctrine\ORM\Event\LifecycleEventArgs;
99
use Gedmo\Mapping\Mock\Mapping\Event\Adapter\ORM as CustomizedORMAdapter;
1010

11-
class MappingEventAdapterTest extends \PHPUnit_Framework_TestCase
11+
class MappingEventAdapterTest extends \PHPUnit\Framework\TestCase
1212
{
1313
public function testCustomizedAdapter()
1414
{

tests/Gedmo/Mapping/MappingTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @link http://www.gediminasm.org
1212
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
1313
*/
14-
class MappingTest extends \PHPUnit_Framework_TestCase
14+
class MappingTest extends \PHPUnit\Framework\TestCase
1515
{
1616
const TEST_ENTITY_CATEGORY = "Tree\Fixture\BehavioralCategory";
1717
const TEST_ENTITY_TRANSLATION = "Gedmo\Translatable\Entity\Translation";

tests/Gedmo/Mapping/MetadataFactory/CustomDriverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @link http://www.gediminasm.org
1212
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
1313
*/
14-
class CustomDriverTest extends \PHPUnit_Framework_TestCase
14+
class CustomDriverTest extends \PHPUnit\Framework\TestCase
1515
{
1616
public function setUp()
1717
{

tests/Gedmo/Mapping/MetadataFactory/ForcedMetadataTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* @link http://www.gediminasm.org
1212
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
1313
*/
14-
class ForcedMetadataTest extends \PHPUnit_Framework_TestCase
14+
class ForcedMetadataTest extends \PHPUnit\Framework\TestCase
1515
{
1616
public function setUp()
1717
{

0 commit comments

Comments
 (0)