-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add unit tests and fix error if Zend\Db\Adapter\Adapter is defined in…
… service manager but not configured
- Loading branch information
1 parent
2b316a8
commit 3880403
Showing
11 changed files
with
115 additions
and
3 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,4 @@ | ||
/nbproject/ | ||
*.phar | ||
vendor/ | ||
composer.lock |
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
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
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
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
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,23 @@ | ||
<?php | ||
|
||
namespace ZfSnapPhpDebugBar\Tests\Functional; | ||
|
||
/** | ||
* DbCollectorTest | ||
* | ||
* @author Witold Wasiczko <witold@wasiczko.pl> | ||
*/ | ||
class DbCollectorTest extends \Zend\Test\PHPUnit\Controller\AbstractHttpControllerTestCase | ||
{ | ||
protected function setUp() | ||
{ | ||
$this->setApplicationConfig(include __DIR__.'/../assets/application.config.php'); | ||
} | ||
|
||
public function testDbIsNotConfigured() | ||
{ | ||
$this->dispatch('/'); | ||
|
||
$this->assertResponseStatusCode(200); | ||
} | ||
} |
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,18 @@ | ||
<?php | ||
|
||
namespace ZfSnapPhpDebugBar\Tests\Functional; | ||
|
||
use Zend\Mvc\Controller\AbstractActionController; | ||
|
||
/** | ||
* DummyController | ||
* | ||
* @author Witold Wasiczko <witold@wasiczko.pl> | ||
*/ | ||
class DummyController extends AbstractActionController | ||
{ | ||
public function indexAction() | ||
{ | ||
return $this->getResponse(); | ||
} | ||
} |
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,12 @@ | ||
<?php | ||
|
||
return array( | ||
'modules' => array( | ||
'ZfSnapPhpDebugBar', | ||
), | ||
'module_listener_options' => array( | ||
'config_glob_paths' => array( | ||
__DIR__.'/local.config.php', | ||
), | ||
), | ||
); |
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,31 @@ | ||
<?php | ||
|
||
return array( | ||
'controllers' => array( | ||
'invokables' => array( | ||
'ZfSnapPhpDebugBar\Tests\Functional\DummyController' => 'ZfSnapPhpDebugBar\Tests\Functional\DummyController', | ||
), | ||
), | ||
'php-debug-bar' => array( | ||
'auto-append-assets' => false, | ||
), | ||
'router' => [ | ||
'routes' => [ | ||
'home' => [ | ||
'type' => 'Zend\Mvc\Router\Http\Literal', | ||
'options' => [ | ||
'route' => '/', | ||
'defaults' => [ | ||
'controller' => 'ZfSnapPhpDebugBar\Tests\Functional\DummyController', | ||
'action' => 'index', | ||
], | ||
], | ||
], | ||
], | ||
], | ||
'service_manager' => array( | ||
'factories' => array( | ||
'Zend\Db\Adapter\Adapter' => 'Zend\Db\Adapter\AdapterServiceFactory', | ||
), | ||
), | ||
); |
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,3 @@ | ||
<?php | ||
|
||
require_once '../vendor/autoload.php'; |
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,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<phpunit bootstrap="bootstrap.php" colors="true"> | ||
<testsuite name="ZfSnapPhpDebugBar"> | ||
<directory>./</directory> | ||
</testsuite> | ||
</phpunit> |