blob: c5ec7dda6fde83cc430ec65240b25e04d851df2c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
<?php
declare(strict_types=1);
namespace PhpMyAdmin\Tests\Controllers\Normalization\SecondNormalForm;
use PhpMyAdmin\ConfigStorage\Relation;
use PhpMyAdmin\Controllers\Normalization\SecondNormalForm\FirstStepController;
use PhpMyAdmin\Http\ServerRequest;
use PhpMyAdmin\Normalization;
use PhpMyAdmin\Template;
use PhpMyAdmin\Tests\AbstractTestCase;
use PhpMyAdmin\Tests\Stubs\ResponseRenderer;
use PhpMyAdmin\Transformations;
/**
* @covers \PhpMyAdmin\Controllers\Normalization\SecondNormalForm\FirstStepController
*/
class FirstStepControllerTest extends AbstractTestCase
{
public function testDefault(): void
{
$GLOBALS['db'] = 'test_db';
$GLOBALS['table'] = 'test_table';
$dbi = $this->createDatabaseInterface();
$GLOBALS['dbi'] = $dbi;
$response = new ResponseRenderer();
$template = new Template();
$controller = new FirstStepController(
$response,
$template,
new Normalization($dbi, new Relation($dbi), new Transformations(), $template)
);
$controller($this->createStub(ServerRequest::class));
$this->assertSame([
'legendText' => 'Step 2.1 Find partial dependencies',
'headText' => 'No partial dependencies possible as the primary key ( id ) has just one column.<br>',
'subText' => '',
'extra' => '<h3>Table is already in second normal form.</h3>',
'primary_key' => 'id',
], $response->getJSONResult());
}
}
|