Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 1 addition & 44 deletions Tests/HelloWorldTest.php
Original file line number Diff line number Diff line change
@@ -1,47 +1,4 @@
<?php

class HelloWorldTest extends PHPUnit_Framework_TestCase
{
/**
* @var PDO
*/
private $pdo;

public function setUp()
{
$this->pdo = new PDO($GLOBALS['db_dsn'], $GLOBALS['db_username'], $GLOBALS['db_password']);
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$this->pdo->query("CREATE TABLE hello (what VARCHAR(50) NOT NULL)");
}

public function tearDown()
{
$this->pdo->query("DROP TABLE hello");
}

public function testHelloWorld()
{
$helloWorld = new HelloWorld($this->pdo);

$this->assertEquals('Hello World', $helloWorld->hello());
}

public function testHello()
{
$helloWorld = new HelloWorld($this->pdo);

$this->assertEquals('Hello Bar', $helloWorld->hello('Bar'));
}

public function testWhat()
{
$helloWorld = new HelloWorld($this->pdo);

$this->assertFalse($helloWorld->what());

$helloWorld->hello('Bar');

$this->assertEquals('Bar', $helloWorld->what());
}
}

>