['event', 'event', 'event', 'event', 'NameOfVenue', 'event', 'period', 'event', 'event'], ]); $pd = json_encode([ '' => [], 'event' => ['TypeOfEvent', 'period', 'Start_time', 'NameOfVenue', 'LocationOfVenue'], 'NameOfVenue' => ['DateOfEvent'], 'period' => ['NumberOfGuests'], ]); $dbi = $this->createDatabaseInterface(); DatabaseInterface::$instance = $dbi; $response = new ResponseRenderer(); $template = new Template(); $request = ServerRequestFactory::create()->createServerRequest('POST', 'https://example.com/') ->withParsedBody([ 'tables' => $tables, 'pd' => $pd, ]); $controller = new NewTablesController( $response, new Normalization($dbi, new Relation($dbi), new Transformations(), $template), ); $controller($request); // phpcs:disable Generic.Files.LineLength.TooLong self::assertSame([ 'html' => '

In order to put the original table \'test_table\' into Third normal form we need to create the following tables:

( event, TypeOfEvent, period, Start_time, NameOfVenue, LocationOfVenue )

( NameOfVenue, DateOfEvent )

( period, NumberOfGuests )', 'newTables' => [ 'test_table' => [ 'test_table' => [ 'pk' => 'event', 'nonpk' => 'TypeOfEvent, period, Start_time, NameOfVenue, LocationOfVenue', ], 'table2' => ['pk' => 'NameOfVenue', 'nonpk' => 'DateOfEvent'], 'table3' => ['pk' => 'period', 'nonpk' => 'NumberOfGuests'], ], ], 'success' => true, ], $response->getJSONResult()); // phpcs:enable } }