Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Open
LU API
Commits
b6c0c857
Commit
b6c0c857
authored
Feb 23, 2022
by
Dainis Abols
Browse files
LessonsTest changes
parent
92b880d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Tests/Functional/LessonsTest.php
View file @
b6c0c857
...
...
@@ -66,7 +66,7 @@ class LessonsTest extends UnitTestCase
$this
->
assertTrue
(
$structure
(
$content
),
'Lessons structure does not match'
);
// Check items object
$this
->
assertNotEmpty
(
$content
[
'items'
],
'Lessons has no items received'
);
$this
->
assertNotEmpty
(
$content
[
'items'
],
'Lessons has no items received
. Check if lectures are present!
'
);
// Check data object structure
$this
->
assertTrue
(
count
(
$content
[
'items'
][
0
])
===
9
,
'Lessons items count does not match'
);
...
...
@@ -82,7 +82,7 @@ class LessonsTest extends UnitTestCase
public
function
lessonsSingleRoomJSONTest
()
{
// Get room url
$url
=
$this
->
url
.
'
zinatnu
-maja/search'
;
$url
=
$this
->
url
.
'
dabas
-maja/search'
;
$result
=
(
new
DataHelper
())
->
fetchUrl
(
$url
);
$content
=
@
$result
->
getBody
()
->
getContents
();
$content
=
json_decode
(
$content
,
true
);
...
...
@@ -123,7 +123,7 @@ class LessonsTest extends UnitTestCase
public
function
lessonsHTMLTest
()
{
// Read url
$url
=
$this
->
url
.
'
dabas
-maja/search&visual=1'
;
$url
=
$this
->
url
.
'
zinatnu
-maja/search&visual=1'
;
$result
=
(
new
DataHelper
())
->
fetchUrl
(
$url
);
// Assert url read
...
...
@@ -138,13 +138,13 @@ class LessonsTest extends UnitTestCase
/**
* Single room lessons (JSON) test
*
* @depends lessons
HTML
Test
* @depends lessons
JSON
Test
* @test
*/
public
function
lessonsSingleRoomHTMLTest
()
{
// Get room url
$url
=
$this
->
url
.
'
zinatnu
-maja/search'
;
$url
=
$this
->
url
.
'
dabas
-maja/search'
;
$result
=
(
new
DataHelper
())
->
fetchUrl
(
$url
);
$content
=
@
$result
->
getBody
()
->
getContents
();
$content
=
json_decode
(
$content
,
true
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment