Skip to content

Instantly share code, notes, and snippets.

@testingbot
Created May 4, 2012 09:49
Show Gist options
  • Save testingbot/2593676 to your computer and use it in GitHub Desktop.
Save testingbot/2593676 to your computer and use it in GitHub Desktop.
php send mail on failure
<?php
class SimpleTest extends PHPUnit_Extensions_TestingBotTestCase
{
protected function onNotSuccessfulTest(Exception $e)
{
mail("mail@mail.com", "Failed test", $e->getMessage());
parent::onNotSuccessfulTest($e);
}
public static $browsers = array(
array(
'name' => "Windows firefox 8",
'platform' => 'WINDOWS',
'browser' => 'iexplore',
'browserVersion' => '9'
),
);
protected function setUp()
{
$this->setHost('hub.testingbot.com');
$this->setPort(4444);
$this->setBrowserUrl('http://google.com');
}
public function testAgain()
{
$this->open('/');
$this->assertTitle('Yahoo');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment