1*8ce3bd73SGreg Roach<?php 2*8ce3bd73SGreg Roach 3*8ce3bd73SGreg Roach/** 4*8ce3bd73SGreg Roach * webtrees: online genealogy 5*8ce3bd73SGreg Roach * Copyright (C) 2020 webtrees development team 6*8ce3bd73SGreg Roach * This program is free software: you can redistribute it and/or modify 7*8ce3bd73SGreg Roach * it under the terms of the GNU General Public License as published by 8*8ce3bd73SGreg Roach * the Free Software Foundation, either version 3 of the License, or 9*8ce3bd73SGreg Roach * (at your option) any later version. 10*8ce3bd73SGreg Roach * This program is distributed in the hope that it will be useful, 11*8ce3bd73SGreg Roach * but WITHOUT ANY WARRANTY; without even the implied warranty of 12*8ce3bd73SGreg Roach * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13*8ce3bd73SGreg Roach * GNU General Public License for more details. 14*8ce3bd73SGreg Roach * You should have received a copy of the GNU General Public License 15*8ce3bd73SGreg Roach * along with this program. If not, see <http://www.gnu.org/licenses/>. 16*8ce3bd73SGreg Roach */ 17*8ce3bd73SGreg Roach 18*8ce3bd73SGreg Roachdeclare(strict_types=1); 19*8ce3bd73SGreg Roach 20*8ce3bd73SGreg Roachnamespace Fisharebest\Webtrees\Http\RequestHandlers; 21*8ce3bd73SGreg Roach 22*8ce3bd73SGreg Roachuse Fig\Http\Message\StatusCodeInterface; 23*8ce3bd73SGreg Roachuse Fisharebest\Webtrees\Services\MediaFileService; 24*8ce3bd73SGreg Roachuse Fisharebest\Webtrees\TestCase; 25*8ce3bd73SGreg Roach 26*8ce3bd73SGreg Roach/** 27*8ce3bd73SGreg Roach * Test MediaController class. 28*8ce3bd73SGreg Roach * 29*8ce3bd73SGreg Roach * @covers \Fisharebest\Webtrees\Http\RequestHandlers\UploadMediaAction 30*8ce3bd73SGreg Roach */ 31*8ce3bd73SGreg Roachclass UploadMediaActionTest extends TestCase 32*8ce3bd73SGreg Roach{ 33*8ce3bd73SGreg Roach protected static $uses_database = true; 34*8ce3bd73SGreg Roach 35*8ce3bd73SGreg Roach /** 36*8ce3bd73SGreg Roach * @return void 37*8ce3bd73SGreg Roach */ 38*8ce3bd73SGreg Roach public function testResponseIsOK(): void 39*8ce3bd73SGreg Roach { 40*8ce3bd73SGreg Roach $media_file_service = new MediaFileService(); 41*8ce3bd73SGreg Roach $handler = new UploadMediaAction($media_file_service); 42*8ce3bd73SGreg Roach $request = self::createRequest(); 43*8ce3bd73SGreg Roach $response = $handler->handle($request); 44*8ce3bd73SGreg Roach 45*8ce3bd73SGreg Roach self::assertSame(StatusCodeInterface::STATUS_FOUND, $response->getStatusCode()); 46*8ce3bd73SGreg Roach } 47*8ce3bd73SGreg Roach} 48