rcrowe\Hippy\Tests\Queue\QueueInterfaceTest::testMessageRemoveChecks PHP Method

testMessageRemoveChecks() public method

    public function testMessageRemoveChecks()
    {
        $this->queue->add(new Message());
        $this->queue->add(new Message());
        $this->queue->add(new Message());
        $this->assertTrue($this->queue->offsetExists(0));
        $this->assertTrue($this->queue->offsetExists(1));
        $this->assertTrue($this->queue->offsetExists(2));
        $this->assertFalse($this->queue->offsetExists(3));
        try {
            $this->queue->remove(3);
            $this->assertFalse(true);
        } catch (\OutOfRangeException $ex) {
            $this->assertEquals($ex->getMessage(), 'Unknown index: 3');
        } catch (\Exception $ex) {
            $this->assertFalse(true);
        }
    }