ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SplEditingGUIRequestTest Class Reference

Test editing request class. More...

+ Inheritance diagram for SplEditingGUIRequestTest:
+ Collaboration diagram for SplEditingGUIRequestTest:

Public Member Functions

 testRefId ()
 
 testQuestionId ()
 
 testQuestionIds ()
 
 testPreview ()
 
 testSelectedQuestionTypes ()
 
 testSort ()
 

Protected Member Functions

 tearDown ()
 
 getRequest (array $get, array $post)
 

Detailed Description

Test editing request class.

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 26 of file SplEditingGUIRequestTest.php.

Member Function Documentation

◆ getRequest()

SplEditingGUIRequestTest::getRequest ( array  $get,
array  $post 
)
protected

Definition at line 32 of file SplEditingGUIRequestTest.php.

33 {
34 $http_mock = $this->createMock(ILIAS\HTTP\Services::class);
35 $lng_mock = $this->createMock(ilLanguage::class);
36 $data = new \ILIAS\Data\Factory();
37 $refinery = new \ILIAS\Refinery\Factory($data, $lng_mock);
38 return new \ILIAS\SurveyQuestionPool\Editing\EditingGUIRequest(
39 $http_mock,
41 $get,
42 $post
43 );
44 }
$post
Definition: ltitoken.php:46
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.

References $data, $post, and ILIAS\UI\examples\Layout\Page\Standard\$refinery.

Referenced by testPreview(), testQuestionId(), testQuestionIds(), testRefId(), testSelectedQuestionTypes(), and testSort().

+ Here is the caller graph for this function:

◆ tearDown()

SplEditingGUIRequestTest::tearDown ( )
protected

Definition at line 28 of file SplEditingGUIRequestTest.php.

28 : void
29 {
30 }

◆ testPreview()

SplEditingGUIRequestTest::testPreview ( )

Definition at line 93 of file SplEditingGUIRequestTest.php.

93 : void
94 {
95 $request = $this->getRequest(
96 [
97 "preview" => 1
98 ],
99 []
100 );
101
102 $this->assertEquals(
103 1,
104 $request->getPreview()
105 );
106 }
getRequest(array $get, array $post)

References getRequest().

+ Here is the call graph for this function:

◆ testQuestionId()

SplEditingGUIRequestTest::testQuestionId ( )

Definition at line 61 of file SplEditingGUIRequestTest.php.

61 : void
62 {
63 $request = $this->getRequest(
64 [
65 "q_id" => 33
66 ],
67 []
68 );
69
70 $this->assertEquals(
71 33,
72 $request->getQuestionId()
73 );
74 }

References getRequest().

+ Here is the call graph for this function:

◆ testQuestionIds()

SplEditingGUIRequestTest::testQuestionIds ( )

Definition at line 76 of file SplEditingGUIRequestTest.php.

76 : void
77 {
78 $request = $this->getRequest(
79 [
80
81 ],
82 [
83 "q_id" => ["13", "15", "19"]
84 ]
85 );
86
87 $this->assertEquals(
88 [13, 15, 19],
89 $request->getQuestionIds()
90 );
91 }

References getRequest().

+ Here is the call graph for this function:

◆ testRefId()

SplEditingGUIRequestTest::testRefId ( )

Definition at line 46 of file SplEditingGUIRequestTest.php.

46 : void
47 {
48 $request = $this->getRequest(
49 [
50 "ref_id" => 102
51 ],
52 []
53 );
54
55 $this->assertEquals(
56 102,
57 $request->getRefId()
58 );
59 }

References getRequest().

+ Here is the call graph for this function:

◆ testSelectedQuestionTypes()

SplEditingGUIRequestTest::testSelectedQuestionTypes ( )

Definition at line 108 of file SplEditingGUIRequestTest.php.

108 : void
109 {
110 $request = $this->getRequest(
111 [
112 "sel_question_types" => "Metric"
113 ],
114 []
115 );
116
117 $this->assertEquals(
118 "Metric",
119 $request->getSelectedQuestionTypes()
120 );
121 }

References getRequest().

+ Here is the call graph for this function:

◆ testSort()

SplEditingGUIRequestTest::testSort ( )

Definition at line 123 of file SplEditingGUIRequestTest.php.

123 : void
124 {
125 $request = $this->getRequest(
126 [
127
128 ],
129 [
130 "sort" => [
131 "a" => "a1",
132 "b" => "b1",
133 "c" => "c1",
134 ]
135 ]
136 );
137
138 $this->assertEquals(
139 [
140 "a" => "a1",
141 "b" => "b1",
142 "c" => "c1",
143 ],
144 $request->getSort()
145 );
146 }

References getRequest().

+ Here is the call graph for this function:

The documentation for this class was generated from the following file: