aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRasmus Fuhse <fuhse@data-quest.de>2024-01-17 16:46:09 +0000
committerRasmus Fuhse <fuhse@data-quest.de>2024-01-17 16:46:09 +0000
commitce27c274bd49733630a69b4467b72d3519f9974c (patch)
treee634260969a1cb3ea06f0bc87209292a385350f0 /tests
parent6722029b73e7383856fd0777ca58863c7d0faab4 (diff)
Resolve "Wiki modernisieren"
Closes #3215 Merge request studip/studip!2180
Diffstat (limited to 'tests')
-rw-r--r--tests/_support/_generated/JsonapiTesterActions.php294
-rw-r--r--tests/jsonapi/WikiCreateTest.php9
-rw-r--r--tests/jsonapi/WikiIndexTest.php13
-rw-r--r--tests/jsonapi/WikiShowTest.php21
-rw-r--r--tests/jsonapi/WikiUpdateTest.php27
5 files changed, 195 insertions, 169 deletions
diff --git a/tests/_support/_generated/JsonapiTesterActions.php b/tests/_support/_generated/JsonapiTesterActions.php
index c191a3e..5f9e833 100644
--- a/tests/_support/_generated/JsonapiTesterActions.php
+++ b/tests/_support/_generated/JsonapiTesterActions.php
@@ -12,7 +12,7 @@ trait JsonapiTesterActions
*/
abstract protected function getScenario();
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -47,7 +47,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('expectException', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -81,7 +81,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('expectThrowable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -95,7 +95,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotExists', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -110,7 +110,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterOrEquals', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -124,7 +124,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsEmpty', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -139,7 +139,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessOrEquals', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -154,7 +154,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotRegExp', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -169,7 +169,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertRegExp', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -184,7 +184,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertThatItsNot', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -199,7 +199,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayHasKey', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -214,7 +214,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertArrayNotHasKey', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -229,7 +229,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertClassHasAttribute', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -244,7 +244,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertClassHasStaticAttribute', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -259,7 +259,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertClassNotHasAttribute', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -274,7 +274,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertClassNotHasStaticAttribute', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -289,7 +289,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContains', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -302,7 +302,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContainsEquals', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -318,7 +318,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContainsOnly', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -333,7 +333,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertContainsOnlyInstancesOf', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -348,7 +348,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertCount', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -362,7 +362,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryDoesNotExist', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -376,7 +376,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryExists', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -390,7 +390,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryIsNotReadable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -404,7 +404,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryIsNotWritable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -418,7 +418,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryIsReadable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -432,7 +432,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDirectoryIsWritable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -447,7 +447,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertDoesNotMatchRegularExpression', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -461,7 +461,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEmpty', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -476,7 +476,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEquals', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -491,7 +491,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsCanonicalizing', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -506,7 +506,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsIgnoringCase', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -522,7 +522,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertEqualsWithDelta', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -536,7 +536,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFalse', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -550,7 +550,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileDoesNotExist', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -565,7 +565,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileEquals', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -580,7 +580,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileEqualsCanonicalizing', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -595,7 +595,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileEqualsIgnoringCase', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -609,7 +609,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileExists', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -623,7 +623,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileIsNotReadable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -637,7 +637,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileIsNotWritable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -651,7 +651,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileIsReadable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -665,7 +665,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileIsWritable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -680,7 +680,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotEquals', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -695,7 +695,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotEqualsCanonicalizing', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -710,7 +710,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFileNotEqualsIgnoringCase', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -724,7 +724,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertFinite', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -739,7 +739,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThan', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -754,7 +754,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertGreaterThanOrEqual', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -768,7 +768,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInfinite', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -783,7 +783,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertInstanceOf', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -797,7 +797,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsArray', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -811,7 +811,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsBool', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -825,7 +825,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsCallable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -839,7 +839,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsClosedResource', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -853,7 +853,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsFloat', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -867,7 +867,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsInt', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -881,7 +881,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsIterable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -895,7 +895,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotArray', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -909,7 +909,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotBool', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -923,7 +923,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotCallable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -937,7 +937,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotClosedResource', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -951,7 +951,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotFloat', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -965,7 +965,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotInt', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -979,7 +979,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotIterable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -993,7 +993,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotNumeric', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1007,7 +1007,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotObject', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1021,7 +1021,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotReadable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1035,7 +1035,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotResource', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1049,7 +1049,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotScalar', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1063,7 +1063,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotString', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1077,7 +1077,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNotWritable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1091,7 +1091,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsNumeric', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1105,7 +1105,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsObject', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1119,7 +1119,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsReadable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1133,7 +1133,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsResource', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1147,7 +1147,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsScalar', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1161,7 +1161,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsString', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1175,7 +1175,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertIsWritable', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1189,7 +1189,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJson', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1204,7 +1204,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonFileEqualsJsonFile', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1219,7 +1219,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonFileNotEqualsJsonFile', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1234,7 +1234,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonStringEqualsJsonFile', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1249,7 +1249,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonStringEqualsJsonString', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1264,7 +1264,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonStringNotEqualsJsonFile', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1279,7 +1279,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertJsonStringNotEqualsJsonString', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1294,7 +1294,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThan', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1309,7 +1309,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertLessThanOrEqual', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1324,7 +1324,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertMatchesRegularExpression', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1338,7 +1338,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNan', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1353,7 +1353,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContains', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1364,7 +1364,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContainsEquals', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1380,7 +1380,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotContainsOnly', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1395,7 +1395,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotCount', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1409,7 +1409,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEmpty', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1424,7 +1424,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEquals', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1439,7 +1439,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsCanonicalizing', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1454,7 +1454,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsIgnoringCase', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1470,7 +1470,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotEqualsWithDelta', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1484,7 +1484,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotFalse', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1499,7 +1499,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotInstanceOf', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1513,7 +1513,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotNull', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1528,7 +1528,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSame', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1543,7 +1543,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotSameSize', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1557,7 +1557,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNotTrue', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1571,7 +1571,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertNull', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1586,7 +1586,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertObjectHasAttribute', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1601,7 +1601,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertObjectNotHasAttribute', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1616,7 +1616,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSame', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1631,7 +1631,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertSameSize', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1644,7 +1644,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringContainsString', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1655,7 +1655,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringContainsStringIgnoringCase', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1670,7 +1670,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEndsNotWith', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1685,7 +1685,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEndsWith', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1700,7 +1700,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEqualsFile', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1715,7 +1715,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEqualsFileCanonicalizing', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1730,7 +1730,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringEqualsFileIgnoringCase', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1745,7 +1745,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringMatchesFormat', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1760,7 +1760,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringMatchesFormatFile', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1773,7 +1773,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotContainsString', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1786,7 +1786,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotContainsStringIgnoringCase', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1801,7 +1801,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotEqualsFile', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1815,7 +1815,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotEqualsFileCanonicalizing', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1830,7 +1830,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotEqualsFileIgnoringCase', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1845,7 +1845,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotMatchesFormat', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1860,7 +1860,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringNotMatchesFormatFile', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1875,7 +1875,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsNotWith', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1890,7 +1890,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertStringStartsWith', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1905,7 +1905,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertThat', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1919,7 +1919,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertTrue', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1934,7 +1934,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlFileEqualsXmlFile', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1949,7 +1949,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlFileNotEqualsXmlFile', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1964,7 +1964,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlStringEqualsXmlFile', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1979,7 +1979,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlStringEqualsXmlString', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -1994,7 +1994,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlStringNotEqualsXmlFile', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -2009,7 +2009,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('assertXmlStringNotEqualsXmlString', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -2022,7 +2022,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('fail', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -2035,7 +2035,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('markTestIncomplete', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -2048,7 +2048,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('markTestSkipped', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -2059,7 +2059,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('getCredentialsForTestAutor', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -2070,7 +2070,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('getCredentialsForTestDozent', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -2081,7 +2081,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('getCredentialsForTestAdmin', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -2092,7 +2092,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('getCredentialsForRoot', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -2108,7 +2108,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('withPHPLib', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -2125,7 +2125,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('createApp', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -2138,7 +2138,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('createRequestBuilder', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
@@ -2151,7 +2151,7 @@ trait JsonapiTesterActions
return $this->getScenario()->runStep(new \Codeception\Step\Action('sendMockRequest', func_get_args()));
}
-
+
/**
* [!] Method is generated. Documentation taken from corresponding module.
*
diff --git a/tests/jsonapi/WikiCreateTest.php b/tests/jsonapi/WikiCreateTest.php
index 114d450..842db1f 100644
--- a/tests/jsonapi/WikiCreateTest.php
+++ b/tests/jsonapi/WikiCreateTest.php
@@ -12,6 +12,7 @@ class WikiCreateTest extends \Codeception\Test\Unit
protected function _before()
{
\DBManager::getInstance()->setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh);
+ \WikiPage::deleteBySQL('1');
}
protected function _after()
@@ -24,22 +25,22 @@ class WikiCreateTest extends \Codeception\Test\Unit
$credentials = $this->tester->getCredentialsForTestAutor();
$rangeId = 'a07535cf2f8a72df33c12ddfa4b53dde';
- $keyword = 'IphiklosIphitos';
+ $name = 'IphiklosIphitos';
$content = 'This is just fake wiki.';
$json = [
'data' => [
'type' => 'wiki',
- 'attributes' => compact('keyword', 'content'),
+ 'attributes' => compact('name', 'content'),
],
];
- $this->tester->assertCount(0, \WikiPage::findLatestPages($rangeId));
+ $this->tester->assertCount(0, \WikiPage::findBySQL('`range_id` = ?', [$rangeId]));
$response = $this->createWikiPage($credentials, $rangeId, $json);
$this->tester->assertSame(201, $response->getStatusCode());
- $this->tester->assertCount(1, \WikiPage::findLatestPages($rangeId));
+ $this->tester->assertCount(1, \WikiPage::findBySQL('`range_id` = ?', [$rangeId]));
$page = $response->document()->primaryResource();
diff --git a/tests/jsonapi/WikiIndexTest.php b/tests/jsonapi/WikiIndexTest.php
index 8fd8e96..a0b29e2 100644
--- a/tests/jsonapi/WikiIndexTest.php
+++ b/tests/jsonapi/WikiIndexTest.php
@@ -27,7 +27,7 @@ class WikiIndexTest extends \Codeception\Test\Unit
$this->createWikiPage($credentials['id'], $rangeId, 'yxilo', $body);
$this->createWikiPage($credentials['id'], $rangeId, 'ulyq', $body);
- $countPages = \WikiPage::findLatestPages($rangeId);
+ $countPages = \WikiPage::findBySQL('`range_id` = ?', [$rangeId]);
$this->tester->assertCount(2, $countPages);
$response = $this->getWikiIndex($credentials, $rangeId);
@@ -63,22 +63,21 @@ class WikiIndexTest extends \Codeception\Test\Unit
}
- private function createWikiPage($userId, $courseId, $keyword, $body)
+ private function createWikiPage($userId, $courseId, $keyword, $content)
{
// EVIL HACK
$oldPerm = $GLOBALS['perm'] ?? null;
$oldUser = $GLOBALS['user'] ?? null;
$GLOBALS['perm'] = new \Seminar_Perm();
- $GLOBALS['user'] = \User::find($userId);
+ $GLOBALS['user'] = new \Seminar_User(\User::find($userId));
- $latest = \WikiPage::findLatestPage($courseId, $keyword);
+ $latest = \WikiPage::findOneBySQL('`range_id` = ? AND `name` = ?', [$courseId, $keyword]);
$result = \WikiPage::create(
[
'user_id' => $userId,
'range_id' => $courseId,
- 'keyword' => $keyword,
- 'version' => $latest ? $latest->version + 1 : 1,
- 'body' => $body
+ 'name' => $keyword,
+ 'content' => $content
]
);
diff --git a/tests/jsonapi/WikiShowTest.php b/tests/jsonapi/WikiShowTest.php
index 51135fc..c77aea9 100644
--- a/tests/jsonapi/WikiShowTest.php
+++ b/tests/jsonapi/WikiShowTest.php
@@ -12,6 +12,7 @@ class WikiShowTest extends \Codeception\Test\Unit
protected function _before()
{
\DBManager::getInstance()->setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh);
+ \WikiPage::deleteBySQL('1');
}
protected function _after()
@@ -28,7 +29,7 @@ class WikiShowTest extends \Codeception\Test\Unit
$content = 'Es gibt im Moment in diese Mannschaft, oh, einige Spieler vergessenihren Profi was sie sind. Ich lese nicht sehr viele Zeitungen, aberich habe gehört viele Situationen. Erstens: Wir haben nicht offensivgespielt. Es gibt keine deutsche Mannschaft spielt offensiv und dieNamen offensiv wie Bayern. Letzte Spiel hatten wir in Platz dreiSpitzen: Elber, Jancker und dann Zickler. Wir mussen nicht vergessenZickler. Zickler ist eine Spitzen mehr, Mehmet mehr Basler. Ist klardiese Wörter, ist möglich verstehen, was ich hab’ gesagt? Danke.';
$this->createWikiPage($rangeId, $keyword, $content);
- $this->tester->assertCount(1, \WikiPage::findLatestPages($rangeId));
+ $this->tester->assertCount(1, \WikiPage::findBySQL('`range_id` = ?', [$rangeId]));
$response = $this->getWikiPage($credentials, $rangeId, $keyword);
$this->tester->assertTrue($response->isSuccessfulDocument([200]));
@@ -52,13 +53,25 @@ class WikiShowTest extends \Codeception\Test\Unit
);
}
- private function createWikiPage($rangeId, $keyword, $body)
+ private function createWikiPage($rangeId, $keyword, $content)
{
- $wikiPage = new \WikiPage([$rangeId, $keyword, 0]);
- $wikiPage->body = $body;
+ $credentials = $this->tester->getCredentialsForTestDozent();
+ // EVIL HACK
+ $oldPerm = $GLOBALS['perm'] ?? null;
+ $oldUser = $GLOBALS['user'] ?? null;
+ $GLOBALS['perm'] = new \Seminar_Perm();
+ $GLOBALS['user'] = new \Seminar_User(\User::find($credentials['id']));
+
+ $wikiPage = new \WikiPage();
+ $wikiPage->name = $keyword;
+ $wikiPage->range_id = $rangeId;
+ $wikiPage->content = $content;
$wikiPage->user_id = 'nobody';
$wikiPage->store();
+ $GLOBALS['perm'] = $oldPerm;
+ $GLOBALS['user'] = $oldUser;
+
return $wikiPage;
}
}
diff --git a/tests/jsonapi/WikiUpdateTest.php b/tests/jsonapi/WikiUpdateTest.php
index 380952b..c46f42c 100644
--- a/tests/jsonapi/WikiUpdateTest.php
+++ b/tests/jsonapi/WikiUpdateTest.php
@@ -12,6 +12,7 @@ class WikiUpdateTest extends \Codeception\Test\Unit
protected function _before()
{
\DBManager::getInstance()->setConnection('studip', $this->getModule('\\Helper\\StudipDb')->dbh);
+ \WikiPage::deleteBySQL('1');
}
protected function _after()
@@ -26,11 +27,11 @@ class WikiUpdateTest extends \Codeception\Test\Unit
$keyword = 'KaineusKalais';
$content = 'This is just fake wiki.';
- $this->createWikiPage($rangeId, $keyword, $content);
+ $createdpage = $this->createWikiPage($rangeId, $keyword, $content);
$newContent = 'Es gibt im Moment in diese Mannschaft, oh, einige Spieler vergessenihren Profi was sie sind. Ich lese nicht sehr viele Zeitungen, aberich habe gehört viele Situationen. Erstens: Wir haben nicht offensivgespielt. Es gibt keine deutsche Mannschaft spielt offensiv und dieNamen offensiv wie Bayern. Letzte Spiel hatten wir in Platz dreiSpitzen: Elber, Jancker und dann Zickler. Wir mussen nicht vergessenZickler. Zickler ist eine Spitzen mehr, Mehmet mehr Basler. Ist klardiese Wörter, ist möglich verstehen, was ich hab’ gesagt? Danke.';
- $response = $this->updateWiki($credentials, $rangeId, $keyword, $newContent);
+ $response = $this->updateWiki($credentials, $rangeId, $createdpage->id, $newContent);
$this->tester->assertSame(200, $response->getStatusCode());
$page = $response->document()->primaryResource();
@@ -38,12 +39,12 @@ class WikiUpdateTest extends \Codeception\Test\Unit
}
//helpers:
- private function updateWiki($credentials, $rangeId, $keyword, $content)
+ private function updateWiki($credentials, $rangeId, $page_id, $content)
{
$json = [
'data' => [
'type' => 'wiki',
- 'id' => $rangeId.'_'.$keyword,
+ 'id' => $page_id,
'attributes' => compact('content')
],
];
@@ -53,7 +54,7 @@ class WikiUpdateTest extends \Codeception\Test\Unit
return $this->tester->sendMockRequest(
$app,
$this->tester->createRequestBuilder($credentials)
- ->setUri('/wiki-pages/'.$rangeId.'_'.$keyword)
+ ->setUri('/wiki-pages/'.$page_id)
->setJsonApiBody($json)
->update()
->getRequest()
@@ -62,11 +63,23 @@ class WikiUpdateTest extends \Codeception\Test\Unit
private function createWikiPage($rangeId, $keyword, $body)
{
- $wikiPage = new \WikiPage([$rangeId, $keyword, 0]);
- $wikiPage->body = $body;
+ $credentials = $this->tester->getCredentialsForTestDozent();
+ // EVIL HACK
+ $oldPerm = $GLOBALS['perm'] ?? null;
+ $oldUser = $GLOBALS['user'] ?? null;
+ $GLOBALS['perm'] = new \Seminar_Perm();
+ $GLOBALS['user'] = new \Seminar_User(\User::find($credentials['id']));
+
+ $wikiPage = new \WikiPage();
+ $wikiPage->range_id = $rangeId;
+ $wikiPage->name = $keyword;
+ $wikiPage->content = $body;
$wikiPage->user_id = 'nobody';
$wikiPage->store();
+ $GLOBALS['perm'] = $oldPerm;
+ $GLOBALS['user'] = $oldUser;
+
return $wikiPage;
}
}