Sokil\Mongo\GridFsTest::testCreateFromFile PHP Method

testCreateFromFile() public method

public testCreateFromFile ( )
    public function testCreateFromFile()
    {
        // create temp file
        $filename = tempnam(sys_get_temp_dir(), 'prefix');
        file_put_contents($filename, 'somebinarydata');
        // store file
        $id = $this->gridFs->storeFile($filename, array('meta1' => 1, 'meta2' => 2));
        $this->assertInstanceOf('\\MongoId', $id);
        unlink($filename);
    }