This repository has been archived by the owner on Mar 19, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All Controllers are tested if the index function is present and responding. Most of the Models are now tested if the fetchAll function is doing well.
- Loading branch information
1 parent
2ef875f
commit cd906a2
Showing
22 changed files
with
635 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace AdminTest\Controller; | ||
|
||
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; | ||
|
||
class AdminControllerTest extends AbstractHttpControllerTestCase | ||
{ | ||
|
||
protected $traceError = true; | ||
|
||
public function setUp() | ||
{ | ||
$this->setApplicationConfig( | ||
include './config/application.config.php' | ||
); | ||
} | ||
|
||
public function testIndexActionCanBeAccessed() | ||
{ | ||
$this->dispatch('/admin'); | ||
$this->assertResponseStatusCode(200); | ||
$this->assertModuleName('Admin'); | ||
$this->assertControllerName('Admin\Controller\Admin'); | ||
$this->assertControllerClass('AdminController'); | ||
$this->assertMatchedRouteName('admin'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
namespace ClientTest\Controller; | ||
|
||
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; | ||
|
||
class ClientControllerTest extends AbstractHttpControllerTestCase | ||
{ | ||
protected $traceError = true; | ||
|
||
public function setUp() | ||
{ | ||
$this->setApplicationConfig( | ||
include './config/application.config.php' | ||
); | ||
} | ||
|
||
public function testIndexActionCanBeAccessed() | ||
{ | ||
$this->dispatch('/client'); | ||
$this->assertResponseStatusCode(200); | ||
$this->assertModuleName('Client'); | ||
$this->assertControllerName('Client\Controller\Client'); | ||
$this->assertControllerClass('ClientController'); | ||
$this->assertMatchedRouteName('client'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace ClientTest\Model; | ||
|
||
use Client\Model\ClientTable; | ||
use Client\Model\Client; | ||
use Zend\Db\ResultSet\ResultSet; | ||
use PHPUnit_Framework_TestCase; | ||
|
||
class ClientTableTest extends PHPUnit_Framework_TestCase | ||
{ | ||
|
||
public function testFetchAllReturnsAllClients() | ||
{ | ||
$resultSet = new ResultSet(); | ||
|
||
$mockTableGateway = $this->getMock( | ||
'Zend\Db\TableGateway\TableGateway', | ||
array('select'), | ||
array(), | ||
'', | ||
false | ||
); | ||
|
||
$mockTableGateway->expects($this->once()) | ||
->method('select') | ||
->with() | ||
->will($this->returnValue($resultSet)); | ||
|
||
$clientTable = new ClientTable($mockTableGateway); | ||
|
||
$this->assertSame($resultSet, $clientTable->fetchAll()); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace DashboardTest\Controller; | ||
|
||
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; | ||
|
||
class DashboardControllerTest extends AbstractHttpControllerTestCase | ||
{ | ||
|
||
protected $traceError = true; | ||
|
||
public function setUp() | ||
{ | ||
$this->setApplicationConfig( | ||
include './config/application.config.php' | ||
); | ||
} | ||
|
||
public function testIndexActionCanBeAccessed() | ||
{ | ||
$this->dispatch('/dashboard'); | ||
$this->assertResponseStatusCode(200); | ||
$this->assertModuleName('Dashboard'); | ||
$this->assertControllerName('Dashboard\Controller\Dashboard'); | ||
$this->assertControllerClass('DashboardController'); | ||
$this->assertMatchedRouteName('dashboard'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace DirectorTest\Controller; | ||
|
||
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; | ||
|
||
class DirectorControllerTest extends AbstractHttpControllerTestCase | ||
{ | ||
|
||
protected $traceError = true; | ||
|
||
public function setUp() | ||
{ | ||
$this->setApplicationConfig( | ||
include './config/application.config.php' | ||
); | ||
} | ||
|
||
public function testIndexActionCanBeAccessed() | ||
{ | ||
$this->dispatch('/director'); | ||
$this->assertResponseStatusCode(200); | ||
$this->assertModuleName('Director'); | ||
$this->assertControllerName('Director\Controller\Director'); | ||
$this->assertControllerClass('DirectorController'); | ||
$this->assertMatchedRouteName('director'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace FileTest\Controller; | ||
|
||
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; | ||
|
||
class FileControllerTest extends AbstractHttpControllerTestCase | ||
{ | ||
|
||
protected $traceError = true; | ||
|
||
public function setUp() | ||
{ | ||
$this->setApplicationConfig( | ||
include './config/application.config.php' | ||
); | ||
} | ||
|
||
public function testIndexActionCanBeAccessed() | ||
{ | ||
$this->dispatch('/file'); | ||
$this->assertResponseStatusCode(200); | ||
$this->assertModuleName('File'); | ||
$this->assertControllerName('File\Controller\File'); | ||
$this->assertControllerClass('FileController'); | ||
$this->assertMatchedRouteName('file'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace FileTest\Model; | ||
|
||
use File\Model\FileTable; | ||
use File\Model\File; | ||
use Zend\Db\ResultSet\ResultSet; | ||
use PHPUnit_Framework_TestCase; | ||
|
||
class FileTableTest extends PHPUnit_Framework_TestCase | ||
{ | ||
|
||
public function testFetchAllReturnsAllJobs() | ||
{ | ||
$resultSet = new ResultSet(); | ||
|
||
$mockTableGateway = $this->getMock( | ||
'Zend\Db\TableGateway\TableGateway', | ||
array('select'), | ||
array(), | ||
'', | ||
false | ||
); | ||
|
||
$mockTableGateway->expects($this->once()) | ||
->method('select') | ||
->with() | ||
->will($this->returnValue($resultSet)); | ||
|
||
$fileTable = new FileTable($mockTableGateway); | ||
|
||
$this->assertSame($resultSet, $fileTable->fetchAll()); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace FilesetTest\Controller; | ||
|
||
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; | ||
|
||
class FilesetControllerTest extends AbstractHttpControllerTestCase | ||
{ | ||
|
||
protected $traceError = true; | ||
|
||
public function setUp() | ||
{ | ||
$this->setApplicationConfig( | ||
include './config/application.config.php' | ||
); | ||
} | ||
|
||
public function testIndexActionCanBeAccessed() | ||
{ | ||
$this->dispatch('/fileset'); | ||
$this->assertResponseStatusCode(200); | ||
$this->assertModuleName('Fileset'); | ||
$this->assertControllerName('Fileset\Controller\Fileset'); | ||
$this->assertControllerClass('FilesetController'); | ||
$this->assertMatchedRouteName('fileset'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace FilesetTest\Model; | ||
|
||
use Fileset\Model\FilesetTable; | ||
use Fileset\Model\Fileset; | ||
use Zend\Db\ResultSet\ResultSet; | ||
use PHPUnit_Framework_TestCase; | ||
|
||
class FilesetTableTest extends PHPUnit_Framework_TestCase | ||
{ | ||
|
||
public function testFetchAllReturnsAllFilesets() | ||
{ | ||
$resultSet = new ResultSet(); | ||
|
||
$mockTableGateway = $this->getMock( | ||
'Zend\Db\TableGateway\TableGateway', | ||
array('select'), | ||
array(), | ||
'', | ||
false | ||
); | ||
|
||
$mockTableGateway->expects($this->once()) | ||
->method('select') | ||
->with() | ||
->will($this->returnValue($resultSet)); | ||
|
||
$filesetTable = new FilesetTable($mockTableGateway); | ||
|
||
$this->assertSame($resultSet, $filesetTable->fetchAll()); | ||
|
||
} | ||
|
||
} |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace LogTest\Controller; | ||
|
||
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; | ||
|
||
class LogControllerTest extends AbstractHttpControllerTestCase | ||
{ | ||
|
||
protected $traceError = true; | ||
|
||
public function setUp() | ||
{ | ||
$this->setApplicationConfig( | ||
include './config/application.config.php' | ||
); | ||
} | ||
|
||
public function testIndexActionCanBeAccessed() | ||
{ | ||
$this->dispatch('/log'); | ||
$this->assertResponseStatusCode(200); | ||
$this->assertModuleName('Log'); | ||
$this->assertControllerName('Log\Controller\Log'); | ||
$this->assertControllerClass('LogController'); | ||
$this->assertMatchedRouteName('log'); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace LogTest\Model; | ||
|
||
use Log\Model\LogTable; | ||
use Log\Model\Log; | ||
use Zend\Db\ResultSet\ResultSet; | ||
use PHPUnit_Framework_TestCase; | ||
|
||
class LogTableTest extends PHPUnit_Framework_TestCase | ||
{ | ||
public function testFetchAllReturnsAllLogs() | ||
{ | ||
$resultSet = new ResultSet(); | ||
|
||
$mockTableGateway = $this->getMock( | ||
'Zend\Db\TableGateway\TableGateway', | ||
array('select'), | ||
array(), | ||
'', | ||
false | ||
); | ||
|
||
$mockTableGateway->expects($this->once()) | ||
->method('select') | ||
->with() | ||
->will($this->returnValue($resultSet)); | ||
|
||
$logTable = new LogTable($mockTableGateway); | ||
|
||
$this->assertSame($resultSet, $logTable->fetchAll()); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace MediaTest\Controller; | ||
|
||
use Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase; | ||
|
||
class MediaControllerTest extends AbstractHttpControllerTestCase | ||
{ | ||
|
||
protected $traceError = true; | ||
|
||
public function setUp() | ||
{ | ||
$this->setApplicationConfig( | ||
include './config/application.config.php' | ||
); | ||
} | ||
|
||
public function testIndexActionCanBeAccessed() | ||
{ | ||
$this->dispatch('/media'); | ||
$this->assertResponseStatusCode(200); | ||
$this->assertModuleName('Media'); | ||
$this->assertControllerName('Media\Controller\Media'); | ||
$this->assertControllerClass('MediaController'); | ||
$this->assertMatchedRouteName('media'); | ||
} | ||
|
||
} |
Oops, something went wrong.