Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Fix for fetching constraint data from Oracle #34

Merged
merged 4 commits into from
Sep 22, 2015
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added test to get metadata constraints from Oracle database
  • Loading branch information
vixriihi committed Sep 2, 2015
commit 515733280f51f568b6a950d5b9eb47260d188b2d
55 changes: 55 additions & 0 deletions test/Metadata/Source/OracleMetadataTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/

namespace ZendTest\Db\Metadata\Source;

use Zend\Db\Adapter\Adapter;
use Zend\Db\Metadata\Source\OracleMetadata;
use ZendTest\Db\Adapter\Driver\Oci8\AbstractIntegrationTest;

/**
* @requires extension oci8
*/
class OracleMetadataTest extends AbstractIntegrationTest
{
/**
* @var OracleMetadata
*/
protected $metadata;

/**
* @var Adapter
*/
protected $adapter;

/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*/
protected function setUp()
{
if (!extension_loaded('oci8')) {
$this->markTestSkipped('I cannot test without the oci8 extension');
}
parent::setUp();
$this->variables['driver'] = 'OCI8';
$this->adapter = new Adapter($this->variables);
$this->metadata = new OracleMetadata($this->adapter);
}

public function testGetConstraints()
{
$constraints = $this->metadata->getConstraints(null, 'main');
$this->assertCount(0, $constraints);
$this->assertContainsOnlyInstancesOf(
'Zend\Db\Metadata\Object\ConstraintObject',
$constraints
);
}
}