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
*/
public function addFlag($flag)
{
$this->flags[strtolower($flag)] = true;
$this->_flags[strtolower($flag)] = true;
return $this;
}
......@@ -273,7 +273,7 @@ class Index extends AbstractAsset implements Constraint
*/
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
*/
public function removeFlag($flag)
{
unset($this->flags[strtolower($flag)]);
unset($this->_flags[strtolower($flag)]);
}
}
......@@ -89,13 +89,16 @@ class IndexTest extends \PHPUnit_Framework_TestCase
{
$idx1 = $this->createIndex();
$this->assertFalse($idx1->hasFlag('clustered'));
$this->assertEmpty($idx1->getFlags());
$idx1->addFlag('clustered');
$this->assertTrue($idx1->hasFlag('clustered'));
$this->assertTrue($idx1->hasFlag('CLUSTERED'));
$this->assertSame(array('clustered'), $idx1->getFlags());
$idx1->removeFlag('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