Skip to content

Commit

Permalink
eddiejaoude#59: Added navigation tests - these need to be improved fo…
Browse files Browse the repository at this point in the history
…r public & private navigation
  • Loading branch information
eddiejaoude committed May 22, 2011
1 parent 09daf33 commit 75a70f9
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
2 changes: 2 additions & 0 deletions application/modules/auth/tests/views/account/eventTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ public function testEventList()

$this->assertQueryCountMin('table.data', 1);
$this->assertQueryCountMin('table.data tbody tr', 1);

$this->mainNavigationCheck();
}

}
5 changes: 5 additions & 0 deletions application/modules/auth/tests/views/login/indexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ class LoginViewTest extends BaseTestCase {
public function setup() {
parent::setUp();
}

public function testNavigation() {
$this->dispatch('/auth/login');
$this->mainNavigationCheck();
}

/**
* Test form exists on login page
Expand Down
5 changes: 5 additions & 0 deletions application/modules/auth/tests/views/password/forgotTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ class ForgotPasswordTest extends BaseTestCase {
public function setup() {
parent::setUp();
}

public function testNavigation() {
$this->dispatch('/auth/password/forgot');
$this->mainNavigationCheck();
}

/**
* Test form
Expand Down
5 changes: 5 additions & 0 deletions application/modules/auth/tests/views/register/indexTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ public function setup() {
parent::setUp();
}

public function testNavigation() {
$this->dispatch('/auth/register');
$this->mainNavigationCheck();
}

public function testForm()
{
$this->dispatch('/auth/register');
Expand Down
5 changes: 5 additions & 0 deletions application/modules/default/tests/views/error/errorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ class ErrorPageTest extends BaseTestCase {
public function setup() {
parent::setUp();
}

public function testNavigation() {
$this->dispatch('/error/error');
$this->mainNavigationCheck();
}

/**
* Test homepage
Expand Down
5 changes: 5 additions & 0 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,9 @@ private function doctrine() {
# database connection
$this->_em = EntityManager::create($this->appConfig->doctrine->connection->toArray(), $config);
}

protected function mainNavigationCheck() {
$this->assertQueryCountMax('ul#navigation', 1);
$this->assertQueryCountMin('ul#navigation li', 2);
}
}

0 comments on commit 75a70f9

Please sign in to comment.