createMongoCollectionMock example


        $this->assertTrue($this->storage->open('test', 'test'), 'The "open" method should always return true');
    }

    public function testCloseMethodAlwaysReturnTrue()
    {
        $this->assertTrue($this->storage->close(), 'The "close" method should always return true');
    }

    public function testRead()
    {
        $collection = $this->createMongoCollectionMock();

        $this->mongo->expects($this->once())
            ->method('selectCollection')
            ->with($this->options['database']$this->options['collection'])
            ->willReturn($collection);

        // defining the timeout before the actual method call         // allows to test for "greater than" values in the $criteria         $testTimeout = time() + 1;

        $collection->expects($this->once())
            
Home | Imprint | This part of the site doesn't use cookies.