This repository has been archived by the owner on Jan 8, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fixes #6768 : boolean false values at priority list should be valid #6773
Closed
Closed
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
e9812a0
Trying to fix #6768: allowing false values in PriorityList
Grundik c77bbe7
Fixes #6768 : boolean values at priority list should be valid
samsonasik b68195f
change return on valid() method
samsonasik 5b4443c
added test for boolean values in ZendTest/Db/Sql/UpdateTest
samsonasik 6f0d29b
fixes cs
samsonasik ef39a7d
Merge branch from "Grundik/zf2" into hotfix/prioritylist
samsonasik 1d2f3f7
add new list insert for null
samsonasik File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,7 +83,7 @@ public function testLIFOOnly() | |
$this->list->insert('foobar', new \stdClass()); | ||
$this->list->insert('barbaz', new \stdClass()); | ||
|
||
$order = array(); | ||
$orders = array(); | ||
|
||
foreach ($this->list as $key => $value) { | ||
$orders[] = $key; | ||
|
@@ -129,7 +129,7 @@ public function testFIFOWithPriority() | |
$this->list->insert('bar', new \stdClass(), 0); | ||
$this->list->insert('baz', new \stdClass(), 1); | ||
|
||
$order = array(); | ||
$orders = array(); | ||
|
||
foreach ($this->list as $key => $value) { | ||
$orders[] = $key; | ||
|
@@ -147,7 +147,7 @@ public function testFIFOOnly() | |
$this->list->insert('foobar', new \stdClass()); | ||
$this->list->insert('barbaz', new \stdClass()); | ||
|
||
$order = array(); | ||
$orders = array(); | ||
|
||
foreach ($this->list as $key => $value) { | ||
$orders[] = $key; | ||
|
@@ -162,7 +162,7 @@ public function testPriorityWithNegativesAndNull() | |
$this->list->insert('bar', new \stdClass(), 1); | ||
$this->list->insert('baz', new \stdClass(), -1); | ||
|
||
$order = array(); | ||
$orders = array(); | ||
|
||
foreach ($this->list as $key => $value) { | ||
$orders[] = $key; | ||
|
@@ -195,4 +195,23 @@ public function testToArray() | |
$this->list->toArray(PriorityList::EXTR_BOTH) | ||
); | ||
} | ||
|
||
/** | ||
* @group ZF2-6768 | ||
*/ | ||
public function testBooleanValuesAreValid() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. was meant this:
|
||
{ | ||
$this->list->insert('foo', false, null); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please, add There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done ;) |
||
$this->list->insert('foo', null, null); | ||
$this->list->insert('bar', 'test', 1); | ||
$this->list->insert('baz', true, -1); | ||
|
||
$orders = array(); | ||
|
||
foreach ($this->list as $key => $value) { | ||
$orders[] = $value; | ||
} | ||
|
||
$this->assertEquals(array('test', false, true), $orders); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 superfluousThere 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 ;)