Jamm\Memory\Tests\TestMemoryObject::test_add PHP Method

test_add() public method

public test_add ( )
    public function test_add()
    {
        $this->mem->del('t1');
        $call1 = $this->mem->add('t1', 1);
        $this->assertTrue($call1);
        $call2 = $this->mem->add('t1', 2);
        $this->assertTrue(!$call2);
        $this->mem->del('t3');
        $call3 = $this->mem->add('t3', 3, 10);
        $this->assertTrue($call3);
        $this->mem->del('t4');
        $call = $this->mem->add('t4', 1, 10, 'tag');
        $this->assertTrue($call);
        $this->mem->del('t5');
        $call = $this->mem->add('t5', 1, 10, array('tag1', 'tag2'));
        $this->assertTrue($call);
    }