Eccube\Tests\Web\Admin\Content\FileControllerTest::testIndexWithUpload PHP Method

testIndexWithUpload() public method

public testIndexWithUpload ( )
    public function testIndexWithUpload()
    {
        $filepath = $this->app['config']['user_data_realdir'] . '/../aaa.html';
        $contents = '<html><body><h1>test</h1></body></html>';
        file_put_contents($filepath, $contents);
        $file = new UploadedFile($filepath, 'aaa.html', 'text/html', null, null, true);
        $crawler = $this->client->request('POST', $this->app->url('admin_content_file'), array('form' => array('_token' => 'dummy', 'create_file' => '', 'file' => $file), 'mode' => 'upload', 'now_dir' => $this->app['config']['user_data_realdir']), array('file' => $file));
        $this->assertTrue($this->client->getResponse()->isSuccessful());
        $this->assertTrue(file_exists($this->app['config']['user_data_realdir'] . '/aaa.html'));
    }