ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
TableGUIRequestTest.php
Go to the documentation of this file.
1 <?php
2 
20 
27 {
28  //protected $backupGlobals = false;
29 
30  protected function setUp(): void
31  {
32  parent::setUp();
33  }
34 
35  protected function tearDown(): void
36  {
37  }
38 
39  protected function getRequest(array $get, array $post): \ILIAS\Table\TableGUIRequest
40  {
41  $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
42  $lng_mock = $this->createMock(ilLanguage::class);
43  $data = new \ILIAS\Data\Factory();
44  $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
45  return new \ILIAS\Table\TableGUIRequest(
46  $http_mock,
47  $refinery,
48  $get,
49  $post
50  );
51  }
52 
53  public function testTableId(): void
54  {
55  $request = $this->getRequest(
56  [
57  "table_id" => "tid"
58  ],
59  []
60  );
61 
62  $this->assertEquals(
63  "tid",
64  $request->getTableId()
65  );
66  }
67 
68  public function testRows(): void
69  {
70  $request = $this->getRequest(
71  [
72  "id_trows" => "22"
73  ],
74  []
75  );
76 
77  $this->assertEquals(
78  22,
79  $request->getRows("id")
80  );
81  }
82 }
Interface Observer Contains several chained tasks and infos about them.
getRequest(array $get, array $post)
Test evaluation request class.
$post
Definition: ltitoken.php:46