Browse Source

Convert the constraint property to a protected one and remove and unused property

Yves P 10 years ago
parent
commit
6ccf13cb17
1 changed files with 6 additions and 7 deletions
  1. 6 7
      src/TestSuite/Fixture/TestFixture.php

+ 6 - 7
src/TestSuite/Fixture/TestFixture.php

@@ -84,7 +84,7 @@ class TestFixture implements FixtureInterface
      *
      * @var array
      */
-    public $constraints = [];
+    protected $_constraints = [];
 
     /**
      * Instantiate the fixture.
@@ -169,7 +169,7 @@ class TestFixture implements FixtureInterface
                 if ($data['type'] !== Table::CONSTRAINT_FOREIGN) {
                     $this->_schema->addConstraint($name, $data);
                 } else {
-                    $this->constraints[$name] = $data;
+                    $this->_constraints[$name] = $data;
                 }
             }
         }
@@ -240,7 +240,6 @@ class TestFixture implements FixtureInterface
             foreach ($queries as $query) {
                 $db->execute($query)->closeCursor();
             }
-            $this->created[] = $db->configName();
         } catch (Exception $e) {
             $msg = sprintf(
                 'Fixture creation for "%s" failed "%s"',
@@ -300,11 +299,11 @@ class TestFixture implements FixtureInterface
      */
     public function createConstraints(ConnectionInterface $db)
     {
-        if (empty($this->constraints)) {
+        if (empty($this->_constraints)) {
             return true;
         }
 
-        foreach ($this->constraints as $name => $data) {
+        foreach ($this->_constraints as $name => $data) {
             $this->_schema->addConstraint($name, $data);
         }
 
@@ -330,7 +329,7 @@ class TestFixture implements FixtureInterface
      */
     public function dropConstraints(ConnectionInterface $db)
     {
-        if (empty($this->constraints)) {
+        if (empty($this->_constraints)) {
             return true;
         }
 
@@ -350,7 +349,7 @@ class TestFixture implements FixtureInterface
             return false;
         }
 
-        foreach ($this->constraints as $name => $data) {
+        foreach ($this->_constraints as $name => $data) {
             $this->_schema->dropConstraint($name);
         }
         return true;