ILIAS  release_8 Revision v8.24
TableGUIRequestTest.php
Go to the documentation of this file.
1<?php
2
3use PHPUnit\Framework\TestCase;
4
10class TableGUIRequestTest extends TestCase
11{
12 //protected $backupGlobals = false;
13
14 protected function setUp(): void
15 {
16 parent::setUp();
17 }
18
19 protected function tearDown(): void
20 {
21 }
22
23 protected function getRequest(array $get, array $post): \ILIAS\Table\TableGUIRequest
24 {
25 $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
26 $lng_mock = $this->createMock(ilLanguage::class);
27 $data = new \ILIAS\Data\Factory();
28 $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
29 return new \ILIAS\Table\TableGUIRequest(
30 $http_mock,
32 $get,
33 $post
34 );
35 }
36
37 public function testTableId(): void
38 {
39 $request = $this->getRequest(
40 [
41 "table_id" => "tid"
42 ],
43 []
44 );
45
46 $this->assertEquals(
47 "tid",
48 $request->getTableId()
49 );
50 }
51
52 public function testRows(): void
53 {
54 $request = $this->getRequest(
55 [
56 "id_trows" => "22"
57 ],
58 []
59 );
60
61 $this->assertEquals(
62 22,
63 $request->getRows("id")
64 );
65 }
66}
Test evaluation request class.
getRequest(array $get, array $post)
$post
Definition: ltitoken.php:49
Refinery Factory $refinery
Class ChatMainBarProvider \MainMenu\Provider.