Alcaeus\MongoDbAdapter\Tests\Mongo\MongoGridFSTest::testStoreByteExceptionWhileInsertingChunks PHP Method

testStoreByteExceptionWhileInsertingChunks() public method

    public function testStoreByteExceptionWhileInsertingChunks()
    {
        $collection = $this->getGridFS();
        $collection->chunks->createIndex(['n' => 1], ['unique' => true]);
        $document = ['n' => 0];
        $collection->chunks->insert($document);
        $this->setExpectedExceptionRegExp('MongoGridFSException', '/Could not store file:.* E11000 duplicate key error .* mongo-php-adapter\\.fs\\.chunks/');
        $collection->storeBytes('foo');
    }