Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Jan 23, 2013
Jump to file or symbol
Failed to load files and symbols.
+5 −9
Split
@@ -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));
@@ -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

Maks3w Jan 23, 2013

Member

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

@samsonasik

samsonasik Jan 23, 2013

Contributor

@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

ralphschindler Jan 23, 2013

Member

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.

}
}