summaryrefslogtreecommitdiff
path: root/_testing/tests/testing/inttests_scope.test.php
blob: 9341ecef88b1c96b9fd9a766d92d6f393cd50ccb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php

/**
 * @group integration
 */
class InttestsResetTest extends DokuWikiTest {
	/**
	 * It should be possible to have two test cases within one test class.
	 */
	function testFirstRun() {
		$request = new TestRequest();
		$response = $request->execute();
		$this->assertTrue(
			strpos($response->getContent(), 'DokuWiki') >= 0,
			'DokuWiki was not a word in the output'
		);
	}

	/**
	 * @depends testFirstRun
	 */
	function testSecondRun() {
		$request = new TestRequest();
		$response = $request->execute();
		$this->assertTrue(
			strpos($response->getContent(), 'DokuWiki') >= 0,
			'DokuWiki was not a word in the output'
		);
	}

	/**
	 * two requests within the same test case should be possible
	 */
	function testMultipleRequests() {
		$request = new TestRequest();
		$response = $request->execute();
		$this->assertTrue(
			strpos($response->getContent(), 'DokuWiki') >= 0,
			'DokuWiki was not a word in the output'
		);

		$request = new TestRequest();
		$response = $request->execute();
		$this->assertTrue(
			strpos($response->getContent(), 'DokuWiki') >= 0,
			'DokuWiki was not a word in the output'
		);
	}
}