/
testLocal.php
executable file
·72 lines (60 loc) · 1.97 KB
/
testLocal.php
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
/* Turn on error reporting */
ini_set('display_errors', 1);
error_reporting(E_ALL);
/* test driver */
require_once(dirname(__FILE__) . '/simpletest/autorun.php');
/* web page test driver */
require_once(dirname(__FILE__) . '/simpletest/web_tester.php');
require_once(dirname(__FILE__) . '/simpletest/reporter.php');
class TestLocal extends WebTestCase{
/* optional constructor to name the test */
function __construct() {
//parent::__construct('Testing ...');
}
/* optional test setup */
function setUp() {
//set precondition
$this->get('http://web.engr.oregonstate.edu/~ratlifri/farming/local.php');
/* $this->showRequest(); */
/* $this->showHeaders(); */
/* $this->showSource(); */
}
/* optional test clean up */
function tearDown() {
//delete temp file
}
/* optional helper method - name must NOT start with test */
function getSomething() {
//things for tests
}
/* one or more test functions - name must start with test */
function testSomething() {
$this->assertResponse(200);
$this->assertNoText('<table>');
$this->assertText('Local Instructions');
$this->assertText('Plant Name');
$this->assertText('Water Amount');
$this->assertText('Sun Level');
$this->assertText('Sun Duration');
$this->assertText('Sun xDay');
$this->assertText('Sun xWeek');
$this->assertText('Food Type');
$this->assertText('Food Amount');
$this->assertText('Food xWeek');
$this->assertText('Food xMonth');
$this->assertText('Groom Type');
$this->assertText('Groom Detail');
$this->assertText('Groom xMonth');
$this->assertText('Organic Name');
$this->assertText('Organic Amount');
$this->assertText('Organic xWeek');
$this->assertText('Organic xMonth');
$this->assertText('Pesticide Type');
$this->assertText('Pesticide Amount');
$this->assertText('Pesticide xMonth');
}
}
$test = new TestLocal();
$test->run(new HtmlReporter());
?>