These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | namespace Doctrine\Tests\DBAL\Driver\IBMDB2; |
||
4 | |||
5 | use Doctrine\Tests\DbalTestCase; |
||
6 | |||
7 | View Code Duplication | class DB2ConnectionTest extends DbalTestCase |
|
0 ignored issues
–
show
|
|||
8 | { |
||
9 | /** |
||
10 | * The ibm_db2 driver connection mock under test. |
||
11 | * |
||
12 | * @var \Doctrine\DBAL\Driver\IBMDB2\DB2Connection|\PHPUnit_Framework_MockObject_MockObject |
||
13 | */ |
||
14 | private $connectionMock; |
||
15 | |||
16 | protected function setUp() |
||
17 | { |
||
18 | if ( ! extension_loaded('ibm_db2')) { |
||
19 | $this->markTestSkipped('ibm_db2 is not installed.'); |
||
20 | } |
||
21 | |||
22 | parent::setUp(); |
||
23 | |||
24 | $this->connectionMock = $this->getMockBuilder('Doctrine\DBAL\Driver\IBMDB2\DB2Connection') |
||
25 | ->disableOriginalConstructor() |
||
26 | ->getMockForAbstractClass(); |
||
27 | } |
||
28 | |||
29 | public function testDoesNotRequireQueryForServerVersion() |
||
30 | { |
||
31 | $this->assertFalse($this->connectionMock->requiresQueryForServerVersion()); |
||
32 | } |
||
33 | } |
||
34 |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.