Using assertContains() with string haystacks is deprecated and will not be supported in PHPUnit 9. Refactor your test to use assertStringContainsString() or assertStringContainsStringIgnoringCase() instead. Using assertNotContains() with string haystacks is deprecated and will not be supported in PHPUnit 9. Refactor your test to use assertStringNotContainsString() or assertStringNotContainsStringIgnoringCase() instead. Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
88 lines
2.2 KiB
PHP
88 lines
2.2 KiB
PHP
<?php
|
|
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
|
/**
|
|
* Holds TransformationOverviewControllerTest class
|
|
*
|
|
* @package PhpMyAdmin-test
|
|
*/
|
|
declare(strict_types=1);
|
|
|
|
namespace PhpMyAdmin\Tests\Controllers;
|
|
|
|
use PhpMyAdmin\Config;
|
|
use PhpMyAdmin\Controllers\TransformationOverviewController;
|
|
use PhpMyAdmin\Response;
|
|
use PhpMyAdmin\Transformations;
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* Tests for TransformationOverviewController class
|
|
*
|
|
* @package PhpMyAdmin-test
|
|
*/
|
|
class TransformationOverviewControllerTest extends TestCase
|
|
{
|
|
/**
|
|
* Prepares environment for the test.
|
|
*
|
|
* @return void
|
|
*/
|
|
protected function setUp(): void
|
|
{
|
|
$GLOBALS['PMA_Config'] = new Config();
|
|
$GLOBALS['PMA_Config']->enableBc();
|
|
|
|
$GLOBALS['server'] = 1;
|
|
$GLOBALS['db'] = 'db';
|
|
$GLOBALS['table'] = 'table';
|
|
$GLOBALS['PMA_PHP_SELF'] = 'index.php';
|
|
}
|
|
|
|
/**
|
|
* @return void
|
|
*/
|
|
public function testIndexAction(): void
|
|
{
|
|
$controller = new TransformationOverviewController(
|
|
Response::getInstance(),
|
|
$GLOBALS['dbi'],
|
|
new Transformations()
|
|
);
|
|
|
|
$actual = $controller->indexAction();
|
|
|
|
$this->assertStringContainsString(
|
|
__('Available MIME types'),
|
|
$actual
|
|
);
|
|
$this->assertStringContainsString(
|
|
'id="transformation">' . __('Available browser display transformations'),
|
|
$actual
|
|
);
|
|
$this->assertStringContainsString(
|
|
'id="input_transformation">' . __('Available input transformations'),
|
|
$actual
|
|
);
|
|
$this->assertStringContainsString(
|
|
'Text/Plain',
|
|
$actual
|
|
);
|
|
$this->assertStringContainsString(
|
|
'Image/JPEG: Inline',
|
|
$actual
|
|
);
|
|
$this->assertStringContainsString(
|
|
'Displays a clickable thumbnail.',
|
|
$actual
|
|
);
|
|
$this->assertStringContainsString(
|
|
'Image/JPEG: Upload',
|
|
$actual
|
|
);
|
|
$this->assertStringContainsString(
|
|
'Image upload functionality which also displays a thumbnail.',
|
|
$actual
|
|
);
|
|
}
|
|
}
|