Skip to content
This repository has been archived by the owner on Jan 8, 2020. It is now read-only.

Update PriorityList.php #6882

Closed
wants to merge 1 commit into from
Closed

Conversation

ha-sash
Copy link

@ha-sash ha-sash commented Nov 16, 2014

fix PriorityList valid current item

fix valid current item
@Martin-P
Copy link
Contributor

Unittest is missing.

Edit: this seems to be a fix for #6881

@ha-sash
Copy link
Author

ha-sash commented Nov 16, 2014

run test for this class fulfills without errors:

sash@SASH-PC /C/Projects/test/zf2/tests (master)
$ phpunit ZendTest/Stdlib/PriorityListTest.php
PHPUnit 4.0.7 by Sebastian Bergmann.

Configuration read from C:\Projects\test\zf2\tests\phpunit.xml

............

Time: 97 ms, Memory: 4.50Mb

←[30;42mOK (12 tests, 17 assertions)←[0m

I added the test for the valid method to the code, it checks this case

    // to file zf2/tests/ZendTest/Stdlib/PriorityListTest.php
    public function testValid() 
    {

    $position = 0;


        $this->list->insert('foo',    'foo_value');
        $this->list->insert('bar',    'bar_value');
        $this->list->insert('baz',    false);
        $this->list->insert('foobar', 'fobar_value');
        $this->list->insert('barbaz',  'barbazvalue');


        foreach($this->list as $value)
        {
            ++$position;
        }

        $this->assertEquals(5, $position);
    }

@samsonasik
Copy link
Contributor

I already created PR #6773 for it. Duplicate, please close this.

@Martin-P
Copy link
Contributor

I added the test for the valid method to the code

I think you forgot to add the test file to this PR, but as this is a duplicate it is not needed anymore.

@Ocramius
Copy link
Member

A test was added to #6773

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants