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\Platforms; |
||
4 | |||
5 | use Doctrine\DBAL\Platforms\SQLServer2008Platform; |
||
6 | use Doctrine\DBAL\Types\Type; |
||
7 | |||
8 | class SQLServer2008PlatformTest extends AbstractSQLServerPlatformTestCase |
||
9 | { |
||
10 | public function createPlatform() |
||
11 | { |
||
12 | return new SQLServer2008Platform; |
||
13 | } |
||
14 | |||
15 | public function testGeneratesTypeDeclarationForDateTimeTz() |
||
16 | { |
||
17 | self::assertEquals( |
||
18 | 'DATETIMEOFFSET(6)', |
||
19 | $this->_platform->getDateTimeTzTypeDeclarationSQL( |
||
20 | array()) |
||
21 | ); |
||
22 | } |
||
23 | |||
24 | View Code Duplication | public function testGetDefaultValueDeclarationSQLForDateType() |
|
0 ignored issues
–
show
|
|||
25 | { |
||
26 | $currentDateSql = $this->_platform->getCurrentDateSQL(); |
||
27 | $field = array( |
||
28 | 'type' => Type::getType('date'), |
||
29 | 'default' => $currentDateSql, |
||
30 | ); |
||
31 | |||
32 | $this->assertEquals( |
||
33 | " DEFAULT '".$currentDateSql."'", |
||
34 | $this->_platform->getDefaultValueDeclarationSQL($field) |
||
35 | ); |
||
36 | } |
||
37 | } |
||
38 |
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.