ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
TableGUIRequestTest.php
Go to the documentation of this file.
1<?php
2
19use PHPUnit\Framework\TestCase;
20
26class TableGUIRequestTest extends TestCase
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,
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}
Test evaluation request class.
getRequest(array $get, array $post)
$post
Definition: ltitoken.php:46
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.