Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Major changes to make the package fully independent.

- Added src and tests subdirectories for PSR-0 compliance.

- Package tests are now runnable with an independent PHPUnit installation. Change to the tests directory and issue `phpunit` to run them.
  • Loading branch information...
commit bd36a595ac75d6309e0f8fe2ff579122f3330d44 1 parent 90e2985
@pmjones pmjones authored
View
0  TODO.md
No changes.
View
14 src.php
@@ -1,8 +1,8 @@
<?php
-require_once __DIR__ . '/src/Exception.php';
-require_once __DIR__ . '/src/Handler.php';
-require_once __DIR__ . '/src/HandlerFactory.php';
-require_once __DIR__ . '/src/Manager.php';
-require_once __DIR__ . '/src/Result.php';
-require_once __DIR__ . '/src/ResultCollection.php';
-require_once __DIR__ . '/src/ResultFactory.php';
+require_once __DIR__ . '/src/Aura/Signal/Exception.php';
+require_once __DIR__ . '/src/Aura/Signal/Handler.php';
+require_once __DIR__ . '/src/Aura/Signal/HandlerFactory.php';
+require_once __DIR__ . '/src/Aura/Signal/Manager.php';
+require_once __DIR__ . '/src/Aura/Signal/Result.php';
+require_once __DIR__ . '/src/Aura/Signal/ResultCollection.php';
+require_once __DIR__ . '/src/Aura/Signal/ResultFactory.php';
View
0  src/Exception.php → src/Aura/Signal/Exception.php
File renamed without changes
View
0  src/Handler.php → src/Aura/Signal/Handler.php
File renamed without changes
View
0  src/HandlerFactory.php → src/Aura/Signal/HandlerFactory.php
File renamed without changes
View
4 src/Manager.php → src/Aura/Signal/Manager.php
@@ -97,12 +97,12 @@ public function __construct(
HandlerFactory $handler_factory,
ResultFactory $result_factory,
ResultCollection $result_collection,
- array $handlers = null
+ array $handlers = array()
) {
$this->handler_factory = $handler_factory;
$this->result_factory = $result_factory;
$this->result_collection = $result_collection;
- foreach ((array) $handlers as $handler) {
+ foreach ($handlers as $handler) {
list($sender, $signal, $callback) = $handler;
if (isset($handler[3])) {
$position = $handler[3];
View
0  src/Result.php → src/Aura/Signal/Result.php
File renamed without changes
View
0  src/ResultCollection.php → src/Aura/Signal/ResultCollection.php
File renamed without changes
View
0  src/ResultFactory.php → src/Aura/Signal/ResultFactory.php
File renamed without changes
View
0  tests/HandlerTest.php → tests/Aura/Signal/HandlerTest.php
File renamed without changes
View
0  tests/ManagerTest.php → tests/Aura/Signal/ManagerTest.php
File renamed without changes
View
0  tests/ResultCollectionTest.php → tests/Aura/Signal/ResultCollectionTest.php
File renamed without changes
View
0  tests/ResultTest.php → tests/Aura/Signal/ResultTest.php
File renamed without changes
View
17 tests/bootstrap.php
@@ -0,0 +1,17 @@
+<?php
+spl_autoload_register(function($class) {
+ $dir = dirname(__DIR__);
+ $file = str_replace('\\', DIRECTORY_SEPARATOR, $class) . '.php';
+ $src = $dir . DIRECTORY_SEPARATOR . 'src'. DIRECTORY_SEPARATOR . $file;
+ if (file_exists($src)) {
@harikt Collaborator
harikt added a note

Isn't it good to check whether its is_readable() ? Sometimes file exists , but not readable .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ require $src;
+ return true;
+ }
+ $tests = $dir . DIRECTORY_SEPARATOR . 'tests' . DIRECTORY_SEPARATOR . $file;
+ if (file_exists($tests)) {
@harikt Collaborator
harikt added a note

is_readable() seems more logical .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ require $tests;
+ return true;
+ }
+
+ return false;
+});
View
7 tests/phpunit.xml
@@ -0,0 +1,7 @@
+<phpunit bootstrap="./bootstrap.php">
+ <testsuites>
+ <testsuite>
+ <directory>.</directory>
+ </testsuite>
+ </testsuites>
+</phpunit>
Please sign in to comment.
Something went wrong with that request. Please try again.