-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Fixes #6768 : boolean false values at priority list should be valid #6773
Conversation
Hi, this is a critical issue, it prevents us to upgrade from zf 2.2 to zf 2.3. As their are unit tests is it possible to quickly integrate this fix in the next minor version of the framework ? Thanks. |
@@ -227,7 +235,8 @@ public function next() | |||
*/ | |||
public function valid() | |||
{ | |||
return ($this->current() !== false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enough return (current($this->items) !== false);
protected $currentNode = false;
is superfluous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ;). thank you ;)
faf7f7b
to
5b4443c
Compare
Conflicts: library/Zend/Stdlib/PriorityList.php
*/ | ||
public function testBooleanValuesAreValid() | ||
{ | ||
$this->list->insert('foo', false, null); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please, add $this->list->insert('foo', null, null);
here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done ;)
/** | ||
* @group ZF2-6768 | ||
*/ | ||
public function testBooleanValuesAreValid() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was meant this:
$this->list->insert('null', null, null);
$this->list->insert('false', false, null);
$this->list->insert('string', 'test', 1);
$this->list->insert('true', true, -1);
$orders1 = array();
$orders2 = array();
foreach ($this->list as $key => $value) {
$orders1[$this->list->key()] = $this->list->current();
$orders2[$key] = $value;
}
$this->assertEquals($orders1, $orders2);
$this->assertEquals(
array(
'null' => null,
'false' => false,
'string' => 'test',
'true' => true,
),
$orders2
);
@Ocramius this is realy critical bug |
… into its own test method with `@group` annotations
…erations syntax and simplifying code
@Ocramius test case on develop failure, it seems some commits in master in |
@samsonasik thanks for noticing. This is indeed a merge conflict SNAFU. Will fix right now. |
@samsonasik interestingly, |
@Ocramius latest master : It seems I need to rollback to use "hold" currentNode like this : samsonasik@e9812a0 ? |
@samsonasik besides that, the unit test in |
@samsonasik I try to use all your tests without |
@Ocramius @samsonasik sorry - all ok |
…dding missing @group annotations
…emoving unused protected property
…emoving redundant docblocks, cleaning up comparison operations syntax and simplifying code
…ues-in-priority-list' into 'develop' Close zendframework/zendframework#6773 Close zendframework/zendframework#6768 Close zendframework/zendframework#6820 Close zendframework/zendframework#6834 Close zendframework/zendframework#6881 Forward port zendframework/zendframework#6773 Forward port zendframework/zendframework#6768
…valid()` should return `true` also for `false` and `null` values in the `PriorityList`
Fixes #6768