Commit 1f728488 authored by Steve Müller's avatar Steve Müller

fix index flags

parent 2196da9c
...@@ -259,7 +259,7 @@ class Index extends AbstractAsset implements Constraint ...@@ -259,7 +259,7 @@ class Index extends AbstractAsset implements Constraint
*/ */
public function addFlag($flag) public function addFlag($flag)
{ {
$this->flags[strtolower($flag)] = true; $this->_flags[strtolower($flag)] = true;
return $this; return $this;
} }
...@@ -273,7 +273,7 @@ class Index extends AbstractAsset implements Constraint ...@@ -273,7 +273,7 @@ class Index extends AbstractAsset implements Constraint
*/ */
public function hasFlag($flag) public function hasFlag($flag)
{ {
return isset($this->flags[strtolower($flag)]); return isset($this->_flags[strtolower($flag)]);
} }
/** /**
...@@ -285,6 +285,6 @@ class Index extends AbstractAsset implements Constraint ...@@ -285,6 +285,6 @@ class Index extends AbstractAsset implements Constraint
*/ */
public function removeFlag($flag) public function removeFlag($flag)
{ {
unset($this->flags[strtolower($flag)]); unset($this->_flags[strtolower($flag)]);
} }
} }
...@@ -89,13 +89,16 @@ class IndexTest extends \PHPUnit_Framework_TestCase ...@@ -89,13 +89,16 @@ class IndexTest extends \PHPUnit_Framework_TestCase
{ {
$idx1 = $this->createIndex(); $idx1 = $this->createIndex();
$this->assertFalse($idx1->hasFlag('clustered')); $this->assertFalse($idx1->hasFlag('clustered'));
$this->assertEmpty($idx1->getFlags());
$idx1->addFlag('clustered'); $idx1->addFlag('clustered');
$this->assertTrue($idx1->hasFlag('clustered')); $this->assertTrue($idx1->hasFlag('clustered'));
$this->assertTrue($idx1->hasFlag('CLUSTERED')); $this->assertTrue($idx1->hasFlag('CLUSTERED'));
$this->assertSame(array('clustered'), $idx1->getFlags());
$idx1->removeFlag('clustered'); $idx1->removeFlag('clustered');
$this->assertFalse($idx1->hasFlag('clustered')); $this->assertFalse($idx1->hasFlag('clustered'));
$this->assertEmpty($idx1->getFlags());
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment