Skip to content

Commit 94f7ce0

Browse files
authored
PHPLIB-589 Drop support for PHP 7.0 (#836)
* Drop support for PHP 7.0 * Remove usage of SetupTeardownTrait
1 parent ea9853a commit 94f7ce0

28 files changed

+36
-119
lines changed

.evergreen/config.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -400,10 +400,6 @@ axes:
400400
display_name: "7.1"
401401
variables:
402402
PHP_VERSION: "7.1.31"
403-
- id: "7.0"
404-
display_name: "7.0"
405-
variables:
406-
PHP_VERSION: "7.0.32"
407403

408404
- id: php-edge-versions
409405
display_name: PHP Version
@@ -413,9 +409,9 @@ axes:
413409
variables:
414410
PHP_VERSION: "7.4.7"
415411
- id: "oldest-supported"
416-
display_name: "7.0"
412+
display_name: "7.1"
417413
variables:
418-
PHP_VERSION: "7.0.32"
414+
PHP_VERSION: "7.1.31"
419415

420416
- id: versions
421417
display_name: MongoDB Version

.evergreen/install-dependencies.sh

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@ set_php_version ()
2929

3030
install_extension ()
3131
{
32-
# Workaround to get PECL running on PHP 7.0
33-
export PHP_PEAR_PHP_BIN=${PHP_PATH}/bin/php
34-
export PHP_PEAR_INSTALL_DIR=${PHP_PATH}/lib/php
35-
3632
rm -f ${PHP_PATH}/lib/php.ini
3733

3834
if [ "x${EXTENSION_BRANCH}" != "x" ] || [ "x${EXTENSION_REPO}" != "x" ]; then

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{ "name": "Jeremy Mikola", "email": "[email protected]" }
1010
],
1111
"require": {
12-
"php": "^7.0 || ^8.0",
12+
"php": "^7.1 || ^8.0",
1313
"ext-hash": "*",
1414
"ext-json": "*",
1515
"ext-mongodb": "^1.10.0",

tests/ClientFunctionalTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use MongoDB\Driver\Session;
99
use MongoDB\Model\DatabaseInfo;
1010
use MongoDB\Model\DatabaseInfoIterator;
11-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1211
use function call_user_func;
1312
use function is_callable;
1413
use function sprintf;
@@ -19,12 +18,10 @@
1918
*/
2019
class ClientFunctionalTest extends FunctionalTestCase
2120
{
22-
use SetUpTearDownTrait;
23-
2421
/** @var Client */
2522
private $client;
2623

27-
private function doSetUp()
24+
public function setUp() : void
2825
{
2926
parent::setUp();
3027

tests/Collection/CrudSpecFunctionalTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use MongoDB\UpdateResult;
1515
use MultipleIterator;
1616
use PHPUnit_Framework_SkippedTestError;
17-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1817
use function array_diff_key;
1918
use function array_key_exists;
2019
use function array_map;
@@ -36,12 +35,10 @@
3635
*/
3736
class CrudSpecFunctionalTest extends FunctionalTestCase
3837
{
39-
use SetUpTearDownTrait;
40-
4138
/** @var Collection */
4239
private $expectedCollection;
4340

44-
private function doSetUp()
41+
public function setUp() : void
4542
{
4643
parent::setUp();
4744

tests/Collection/FunctionalTestCase.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@
44

55
use MongoDB\Collection;
66
use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase;
7-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
87

98
/**
109
* Base class for Collection functional tests.
1110
*/
1211
abstract class FunctionalTestCase extends BaseFunctionalTestCase
1312
{
14-
use SetUpTearDownTrait;
15-
1613
/** @var Collection */
1714
protected $collection;
1815

19-
private function doSetUp()
16+
public function setUp() : void
2017
{
2118
parent::setUp();
2219

@@ -25,7 +22,7 @@ private function doSetUp()
2522
$this->dropCollection();
2623
}
2724

28-
private function doTearDown()
25+
public function tearDown() : void
2926
{
3027
if ($this->hasFailed()) {
3128
return;

tests/Database/FunctionalTestCase.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,16 @@
44

55
use MongoDB\Database;
66
use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase;
7-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
87

98
/**
109
* Base class for Database functional tests.
1110
*/
1211
abstract class FunctionalTestCase extends BaseFunctionalTestCase
1312
{
14-
use SetUpTearDownTrait;
15-
1613
/** @var Database */
1714
protected $database;
1815

19-
private function doSetUp()
16+
public function setUp() : void
2017
{
2118
parent::setUp();
2219

tests/DocumentationExamplesTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use MongoDB\Driver\Exception\Exception;
1010
use MongoDB\Driver\ReadPreference;
1111
use MongoDB\Driver\WriteConcern;
12-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1312
use function in_array;
1413
use function ob_end_clean;
1514
use function ob_start;
@@ -25,16 +24,14 @@
2524
*/
2625
class DocumentationExamplesTest extends FunctionalTestCase
2726
{
28-
use SetUpTearDownTrait;
29-
30-
private function doSetUp()
27+
public function setUp() : void
3128
{
3229
parent::setUp();
3330

3431
$this->dropCollection();
3532
}
3633

37-
private function doTearDown()
34+
public function tearDown() : void
3835
{
3936
if ($this->hasFailed()) {
4037
return;

tests/FunctionalTestCase.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use MongoDB\Operation\DatabaseCommand;
1818
use MongoDB\Operation\DropCollection;
1919
use stdClass;
20-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
2120
use UnexpectedValueException;
2221
use function array_merge;
2322
use function count;
@@ -42,23 +41,21 @@
4241

4342
abstract class FunctionalTestCase extends TestCase
4443
{
45-
use SetUpTearDownTrait;
46-
4744
/** @var Manager */
4845
protected $manager;
4946

5047
/** @var array */
5148
private $configuredFailPoints = [];
5249

53-
private function doSetUp()
50+
public function setUp() : void
5451
{
5552
parent::setUp();
5653

5754
$this->manager = static::createTestManager();
5855
$this->configuredFailPoints = [];
5956
}
6057

61-
private function doTearDown()
58+
public function tearDown() : void
6259
{
6360
$this->disableFailPoints();
6461

tests/GridFS/FunctionalTestCase.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use MongoDB\Collection;
66
use MongoDB\GridFS\Bucket;
77
use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase;
8-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
98
use function fopen;
109
use function fwrite;
1110
use function get_resource_type;
@@ -17,8 +16,6 @@
1716
*/
1817
abstract class FunctionalTestCase extends BaseFunctionalTestCase
1918
{
20-
use SetUpTearDownTrait;
21-
2219
/** @var Bucket */
2320
protected $bucket;
2421

@@ -28,7 +25,7 @@ abstract class FunctionalTestCase extends BaseFunctionalTestCase
2825
/** @var Collection */
2926
protected $filesCollection;
3027

31-
private function doSetUp()
28+
public function setUp() : void
3229
{
3330
parent::setUp();
3431

tests/GridFS/ReadableStreamFunctionalTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,17 @@
88
use MongoDB\GridFS\Exception\CorruptFileException;
99
use MongoDB\GridFS\ReadableStream;
1010
use MongoDB\Tests\CommandObserver;
11-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1211
use function array_filter;
1312

1413
/**
1514
* Functional tests for the internal ReadableStream class.
1615
*/
1716
class ReadableStreamFunctionalTest extends FunctionalTestCase
1817
{
19-
use SetUpTearDownTrait;
20-
2118
/** @var CollectionWrapper */
2219
private $collectionWrapper;
2320

24-
private function doSetUp()
21+
public function setUp() : void
2522
{
2623
parent::setUp();
2724

tests/GridFS/StreamWrapperFunctionalTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use MongoDB\BSON\Binary;
66
use MongoDB\BSON\UTCDateTime;
7-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
87
use function fclose;
98
use function feof;
109
use function fread;
@@ -20,9 +19,7 @@
2019
*/
2120
class StreamWrapperFunctionalTest extends FunctionalTestCase
2221
{
23-
use SetUpTearDownTrait;
24-
25-
private function doSetUp()
22+
public function setUp() : void
2623
{
2724
parent::setUp();
2825

tests/GridFS/WritableStreamFunctionalTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,17 @@
55
use MongoDB\Exception\InvalidArgumentException;
66
use MongoDB\GridFS\CollectionWrapper;
77
use MongoDB\GridFS\WritableStream;
8-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
98
use function str_repeat;
109

1110
/**
1211
* Functional tests for the internal WritableStream class.
1312
*/
1413
class WritableStreamFunctionalTest extends FunctionalTestCase
1514
{
16-
use SetUpTearDownTrait;
17-
1815
/** @var CollectionWrapper */
1916
private $collectionWrapper;
2017

21-
private function doSetUp()
18+
public function setUp() : void
2219
{
2320
parent::setUp();
2421

tests/Model/ChangeStreamIteratorTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,15 @@
1111
use MongoDB\Operation\Find;
1212
use MongoDB\Tests\CommandObserver;
1313
use MongoDB\Tests\FunctionalTestCase;
14-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1514
use function array_merge;
1615
use function sprintf;
1716

1817
class ChangeStreamIteratorTest extends FunctionalTestCase
1918
{
20-
use SetUpTearDownTrait;
21-
2219
/** @var Collection */
2320
private $collection;
2421

25-
private function doSetUp()
22+
public function setUp() : void
2623
{
2724
parent::setUp();
2825

tests/Model/IndexInfoFunctionalTest.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,25 +4,22 @@
44

55
use MongoDB\Collection;
66
use MongoDB\Tests\FunctionalTestCase;
7-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
87
use function version_compare;
98

109
class IndexInfoFunctionalTest extends FunctionalTestCase
1110
{
12-
use SetUpTearDownTrait;
13-
1411
/** @var Collection */
1512
private $collection;
1613

17-
private function doSetUp()
14+
public function setUp() : void
1815
{
1916
parent::setUp();
2017

2118
$this->collection = new Collection($this->manager, $this->getDatabaseName(), $this->getCollectionName());
2219
$this->collection->drop();
2320
}
2421

25-
private function doTearDown()
22+
public function tearDown() : void
2623
{
2724
if ($this->hasFailed()) {
2825
return;

tests/Operation/BulkWriteFunctionalTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@
1111
use MongoDB\Model\BSONDocument;
1212
use MongoDB\Operation\BulkWrite;
1313
use MongoDB\Tests\CommandObserver;
14-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1514
use function version_compare;
1615

1716
class BulkWriteFunctionalTest extends FunctionalTestCase
1817
{
19-
use SetUpTearDownTrait;
20-
2118
/** @var Collection */
2219
private $collection;
2320

24-
private function doSetUp()
21+
public function setUp() : void
2522
{
2623
parent::setUp();
2724

tests/Operation/DeleteFunctionalTest.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,17 +9,14 @@
99
use MongoDB\Exception\BadMethodCallException;
1010
use MongoDB\Operation\Delete;
1111
use MongoDB\Tests\CommandObserver;
12-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
1312
use function version_compare;
1413

1514
class DeleteFunctionalTest extends FunctionalTestCase
1615
{
17-
use SetUpTearDownTrait;
18-
1916
/** @var Collection */
2017
private $collection;
2118

22-
private function doSetUp()
19+
public function setUp() : void
2320
{
2421
parent::setUp();
2522

tests/Operation/FunctionalTestCase.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,20 @@
55
use MongoDB\Driver\ReadConcern;
66
use MongoDB\Driver\WriteConcern;
77
use MongoDB\Tests\FunctionalTestCase as BaseFunctionalTestCase;
8-
use Symfony\Bridge\PhpUnit\SetUpTearDownTrait;
98

109
/**
1110
* Base class for Operation functional tests.
1211
*/
1312
abstract class FunctionalTestCase extends BaseFunctionalTestCase
1413
{
15-
use SetUpTearDownTrait;
16-
17-
private function doSetUp()
14+
public function setUp() : void
1815
{
1916
parent::setUp();
2017

2118
$this->dropCollection();
2219
}
2320

24-
private function doTearDown()
21+
public function tearDown() : void
2522
{
2623
if ($this->hasFailed()) {
2724
return;

0 commit comments

Comments
 (0)