Completed
Push — master ( c7757e...39cb21 )
by Luís
16s
created

Functional/Driver/SQLAnywhere/StatementTest.php (2 issues)

1
<?php
2
3
namespace Doctrine\Tests\DBAL\Functional\Driver\SQLAnywhere;
4
5
use Doctrine\DBAL\Driver\SQLAnywhere\Driver;
6
use Doctrine\DBAL\DriverManager;
7
8
class StatementTest extends \Doctrine\Tests\DbalFunctionalTestCase
9
{
10
    protected function setUp()
11
    {
12
        if (! extension_loaded('sqlanywhere')) {
13
            $this->markTestSkipped('sqlanywhere is not installed.');
14
        }
15
16
        parent::setUp();
17
18
        if (! $this->_conn->getDriver() instanceof Driver) {
19
            $this->markTestSkipped('sqlanywhere only test.');
20
        }
21
    }
22
23 View Code Duplication
    public function testNonPersistentStatement()
0 ignored issues
show
This method seems to be duplicated in your project.

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.

Loading history...
24
    {
25
        $params = $this->_conn->getParams();
26
        $params['persistent'] = false;
27
28
        $conn = DriverManager::getConnection($params);
29
30
        $conn->connect();
31
32
        self::assertTrue($conn->isConnected(),'No SQLAnywhere-Connection established');
33
34
        $prepStmt = $conn->prepare('SELECT 1');
35
        self::assertTrue($prepStmt->execute(),' Statement non-persistent failed');
36
    }
37
38 View Code Duplication
    public function testPersistentStatement()
0 ignored issues
show
This method seems to be duplicated in your project.

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.

Loading history...
39
    {
40
        $params = $this->_conn->getParams();
41
        $params['persistent'] = true;
42
43
        $conn = DriverManager::getConnection($params);
44
45
        $conn->connect();
46
47
        self::assertTrue($conn->isConnected(),'No SQLAnywhere-Connection established');
48
49
        $prepStmt = $conn->prepare('SELECT 1');
50
        self::assertTrue($prepStmt->execute(),' Statement persistent failed');
51
    }
52
53
}
54