Alcaeus\MongoDbAdapter\Tests\Mongo\MongoGridFSTest::testStoreFileExceptionWhileInsertingChunks PHP Метод

testStoreFileExceptionWhileInsertingChunks() публичный Метод

    public function testStoreFileExceptionWhileInsertingChunks()
    {
        $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->storeFile(__FILE__);
    }