diff --git a/sample-code/examples/php/SimpleTest.php b/sample-code/examples/php/SimpleTest.php new file mode 100644 index 000000000..81eb0bc56 --- /dev/null +++ b/sample-code/examples/php/SimpleTest.php @@ -0,0 +1,43 @@ + true, + 'port' => 4723, + 'browserName' => 'iOS', + 'desiredCapabilities' => array( + 'version' => '6.0', + 'platform' => 'Mac' + ) + ) + ); + + public function setUp() + { + parent::setUp(); + } + + protected function populate() + { + $elems = $this->byTagName('textField'); + foreach ($elems as $elem) { + $randNum = rand(0, 10); + $elem->value($randNum); + $this->numValues[] = $randNum; + } + } + + public function testUiComputation() + { + $this->populate(); + $buttons = $this->byTagName('button'); + $buttons[0]->click(); + $texts = $this->byTagName('staticText'); + $this->assertEqual(int($texts[0]->text), array_sum($this->numValues)); + } +}