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\OCI8; |
||
4 | |||
5 | use Doctrine\Tests\DbalTestCase; |
||
6 | |||
7 | View Code Duplication | class OCI8ConnectionTest extends DbalTestCase |
|
0 ignored issues
–
show
|
|||
8 | { |
||
9 | /** |
||
10 | * The oci8 driver connection mock under test. |
||
11 | * |
||
12 | * @var \Doctrine\DBAL\Driver\OCI8\OCI8Connection|\PHPUnit_Framework_MockObject_MockObject |
||
13 | */ |
||
14 | private $connectionMock; |
||
15 | |||
16 | protected function setUp() |
||
17 | { |
||
18 | if ( ! extension_loaded('oci8')) { |
||
19 | $this->markTestSkipped('oci8 is not installed.'); |
||
20 | } |
||
21 | |||
22 | parent::setUp(); |
||
23 | |||
24 | $this->connectionMock = $this->getMockBuilder('Doctrine\DBAL\Driver\OCI8\OCI8Connection') |
||
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.