Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

[2.1] Fix variable Name and Resource on Oracle Driver Test #3531

Merged
merged 2 commits into from

3 participants

@samsonasik

No description provided.

@Maks3w Maks3w commented on the diff
...t/Db/Adapter/Driver/Oci8/StatementIntegrationTest.php
@@ -90,6 +90,6 @@ public function testExecute()
$result = $statement->execute();
$this->assertInstanceOf('Zend\Db\Adapter\Driver\Oci8\Result', $result);
- unset($resource, $sqlsrvResource);
+ unset($resource, $oci8);
@Maks3w Collaborator
Maks3w added a note

what is the purpose of this unset?

There are some vars declared in this unset not defined in the tests.

Also if PHPUnit not clear this var automatically then may better use the tearDown method

@Maks3w : I just change it to declared vars because of $sqlsrvResource is undefined, it maybe copy-ed from SqlServer Driver Test.

Should I remove the unset and add tearDown() function with empty body ?

@ralphschindler Collaborator

I generally explicitly unset resources to ensure the resource is closed or goes away completely, esp. during tests when I know a subsequent test will also be creating resources and taxing an outside system - in this case, the Oracle Server connection pool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@ralphschindler ralphschindler merged commit 58e8ec9 into from
@samsonasik samsonasik deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
View
8 tests/ZendTest/Db/Adapter/Driver/Oci8/ConnectionIntegrationTest.php
@@ -25,12 +25,8 @@ public function testGetCurrentSchema()
public function testSetResource()
{
$this->markTestIncomplete('edit this');
- $resource = sqlsrv_connect(
- $this->variables['hostname'], array(
- 'UID' => $this->variables['username'],
- 'PWD' => $this->variables['password']
- )
- );
+ $resource = oci_connect($this->variables['username'], $this->variables['password']);
+
$connection = new Connection(array());
$this->assertSame($connection, $connection->setResource($resource));
View
6 tests/ZendTest/Db/Adapter/Driver/Oci8/StatementIntegrationTest.php
@@ -6,7 +6,7 @@
/**
* @group integration
- * @group integration-sqlsrv
+ * @group integration-oracle
*/
class StatementIntegrationTest extends \PHPUnit_Framework_TestCase
{
@@ -31,7 +31,7 @@ protected function setUp()
}
if (!extension_loaded('oci8')) {
- $this->fail('The phpunit group integration-sqlsrv was enabled, but the extension is not loaded.');
+ $this->fail('The phpunit group integration-oracle was enabled, but the extension is not loaded.');
}
}
@@ -90,6 +90,6 @@ public function testExecute()
$result = $statement->execute();
$this->assertInstanceOf('Zend\Db\Adapter\Driver\Oci8\Result', $result);
- unset($resource, $sqlsrvResource);
+ unset($resource, $oci8);
@Maks3w Collaborator
Maks3w added a note

what is the purpose of this unset?

There are some vars declared in this unset not defined in the tests.

Also if PHPUnit not clear this var automatically then may better use the tearDown method

@Maks3w : I just change it to declared vars because of $sqlsrvResource is undefined, it maybe copy-ed from SqlServer Driver Test.

Should I remove the unset and add tearDown() function with empty body ?

@ralphschindler Collaborator

I generally explicitly unset resources to ensure the resource is closed or goes away completely, esp. during tests when I know a subsequent test will also be creating resources and taxing an outside system - in this case, the Oracle Server connection pool.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
}
}
Something went wrong with that request. Please try again.