Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
82418090
Unverified
Commit
82418090
authored
Aug 09, 2019
by
Andreas Braun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PHPLIB-462: Add compatibility traits for the TestCase class
parent
4fed85fc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
0 deletions
+28
-0
PolyfillAssertTrait.php
tests/Compat/PolyfillAssertTrait.php
+25
-0
TestCase.php
tests/TestCase.php
+3
-0
No files found.
tests/Compat/PolyfillAssertTrait.php
0 → 100644
View file @
82418090
<?php
namespace
MongoDB\Tests\Compat
;
use
PHPUnit\Framework\Assert
;
use
ReflectionClass
;
use
Symfony\Bridge\PhpUnit\Legacy\PolyfillAssertTrait
as
SymfonyPolyfillAssertTrait
;
$r
=
new
ReflectionClass
(
Assert
::
class
);
if
(
!
$r
->
hasMethod
(
'assertEqualsWithDelta'
))
{
/**
* @internal
*/
trait
PolyfillAssertTrait
{
use
SymfonyPolyfillAssertTrait
;
}
}
else
{
/**
* @internal
*/
trait
PolyfillAssertTrait
{
}
}
tests/TestCase.php
View file @
82418090
...
@@ -7,6 +7,7 @@ use MongoDB\Driver\ReadPreference;
...
@@ -7,6 +7,7 @@ use MongoDB\Driver\ReadPreference;
use
MongoDB\Driver\WriteConcern
;
use
MongoDB\Driver\WriteConcern
;
use
MongoDB\Model\BSONArray
;
use
MongoDB\Model\BSONArray
;
use
MongoDB\Model\BSONDocument
;
use
MongoDB\Model\BSONDocument
;
use
MongoDB\Tests\Compat\PolyfillAssertTrait
;
use
PHPUnit\Framework\TestCase
as
BaseTestCase
;
use
PHPUnit\Framework\TestCase
as
BaseTestCase
;
use
InvalidArgumentException
;
use
InvalidArgumentException
;
use
ReflectionClass
;
use
ReflectionClass
;
...
@@ -15,6 +16,8 @@ use Traversable;
...
@@ -15,6 +16,8 @@ use Traversable;
abstract
class
TestCase
extends
BaseTestCase
abstract
class
TestCase
extends
BaseTestCase
{
{
use
PolyfillAssertTrait
;
/**
/**
* Return the connection URI.
* Return the connection URI.
*
*
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment