public function RocketChatTestUnitTest::testRocketChatUnitTestExampleFunction in Rocket.Chat 7
Test RocketChat::checkIfTargetIsRocketChatPath().
Note that no environment is provided; we're just testing the correct behavior of a function when passed specific arguments.
File
- ./
rocket_chat.test, line 71
Class
- RocketChatTestUnitTest
- Although most core test cases are based on DrupalWebTestCase and are functional tests (exercising the web UI) we also have DrupalUnitTestCase, which executes much faster because a Drupal install does not have to be one. No environment is provided to a…
Code
public function testRocketChatUnitTestExampleFunction() {
$paths = [
"<front>",
"node/*",
"admin/chat/*/secret",
"",
];
$state = array();
$state[] = $this
->pathFalseTest($paths, "<front>");
$state[] = $this
->pathTrueTest($paths, "");
$state[] = $this
->pathFalseTest($paths, "<back>");
$state[] = $this
->pathTrueTest($paths, "node");
//node is same as <front>
$state[] = $this
->pathTrueTest($paths, "node/");
$state[] = $this
->pathTrueTest($paths, "node/1");
$state[] = $this
->pathTrueTest($paths, "node/9");
$state[] = $this
->pathTrueTest($paths, "node/42/edit");
$state[] = $this
->pathTrueTest($paths, "admin/chat/superduper/secret");
$state[] = $this
->pathFalseTest($paths, "admin/chat/realyImportant/falseSecret");
$state[] = $this
->pathTrueTest($paths, "admin/chat/realyImportant/f/secret");
$state[] = $this
->pathTrueTest($paths, "admin/chat/realyImportant/f/r/secret");
}