Skip to content

Commit

Permalink
Merge branch 'feature/test-refactor'
Browse files Browse the repository at this point in the history
  • Loading branch information
trq committed May 5, 2012
2 parents 0b3bf7e + 1a9a124 commit 6862067
Show file tree
Hide file tree
Showing 85 changed files with 1,246 additions and 2,444 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -1,2 +1,3 @@
build
tests/log/*
vendor
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -3,7 +3,8 @@ language: php
php:
- 5.4

script: phpunit --configuration tests/phpunit.xml
before_install: curl -s http://getcomposer.org/installer | php -- && php composer.phar install --dev
script: ./vendor/bin/phake dev:tests

notifications:
irc:
Expand Down
2 changes: 0 additions & 2 deletions CONTRIBUTORS

This file was deleted.

6 changes: 6 additions & 0 deletions CONTRIBUTORS.md
@@ -0,0 +1,6 @@
CONTRIBUTORS
============

- Bob Chatman (https://github.com/BobGneu)
- Josh Evens (https://github.com/jevens)
- Tony R Quilkey (https://github.com/trq)
34 changes: 32 additions & 2 deletions Phakefile
Expand Up @@ -5,14 +5,17 @@ group('dev', function() {
desc('Run the unit tests');
task('tests', function($args) {
if (isset($args['verbose'])) {
system('phpunit --colors --debug --verbose --configuration tests/phpunit.xml');
system('phpunit --colors --debug --verbose --configuration vendor/proem/proem-test-suite/phpunit.xml');
} else {
system('phpunit --colors --configuration tests/phpunit.xml');
system('phpunit --colors --configuration vendor/proem/proem-test-suite/phpunit.xml');
}
});

desc('Build the Phar archive');
task('build', 'tests', function($args) {
if (!is_dir('build')) {
mkdir('build');
}
chdir('lib');
$phar = new Phar('proem.phar');
$phar->buildFromDirectory('.');
Expand Down Expand Up @@ -55,7 +58,34 @@ group('dev', function() {
file_put_contents('lib/Proem/Api/Proem.php', $file);
}
});
});

desc('Generate a file of aliased definitions, helpful for IDEs that are having trouble with code completion');
task('gen-ide-help', function() {
function recurseDir($path = '.')
{
$ignore = ['.', '..'];
$dh = @opendir($path);
while(false !== ($file = readdir($dh))) {
if (!in_array($file, $ignore)) {
if (is_dir("$path/$file")) {
recurseDir("$path/$file");
} else {
$filepath = "$path/$file";
foreach (file($filepath) as $line) {
if (preg_match('/^(class|abstract|trait)/', $line, $matches)) {
$type = $matches[1];
$class = str_replace(['lib/Proem/Api/', '.php', '/'], ['Proem/', '', '\\'], "$path/$file");
$extends = str_replace(['lib/', '.php', '/'], ['', '', '\\'], "$path/$file");
echo "$type $class extends $extends {}\n";
}
}
}
}
}
closedir( $dh );
}
recurseDir('lib');
});

task('default', 'dev:tests');
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -33,7 +33,7 @@ Also available now is an irc channel (#proem) on freenode. Join if you have any

#### Committing and Pull Requests

If you wish to contribute code to Proem please make sure you check out the [Issue Tracker](http://github.com/proem/proem/issues).
If you wish to contribute code to Proem please make sure you check out the [Issue Tracker](https://proemframework.atlassian.net).

Next, [create an account on Github](https://github.com/signup/free) (if you haven't done so already).

Expand Down
Binary file removed build/proem.phar
Binary file not shown.
5 changes: 3 additions & 2 deletions composer.json
Expand Up @@ -12,8 +12,9 @@
"homepage": "http://thorpesystems.com"
}
],
"require": {
"require-dev": {
"php": ">=5.4.0",
"jaz303/phake": "dev-master"
"jaz303/phake": "dev-master",
"proem/proem-test-suite": "dev-develop"
}
}
44 changes: 29 additions & 15 deletions lib/Proem/Api/Bootstrap/Filter/Event/Dispatch.php
Expand Up @@ -38,16 +38,20 @@
Proem\Dispatch\Stage as DispatchStage;

/**
* Proem\Api\Bootstrap\Filter\Event\Dispatch
*
* The default "Dispatch" filter event.
*/
class Dispatch extends Event
{
/**
* preIn
* Called prior to inBound.
*
* A listener responding with an object implementing the
* Proem\Dispatch\Template interface, will result in that object being
* placed within the main service manager under the index of *dispatch*.
*
* Called prior to inBound
* @see Proem\Api\Dispatch\Template
* @param Proem\Api\Service\Manager\Template
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap pre.in.dispatch
*/
public function preIn(Manager $assets)
{
Expand All @@ -68,9 +72,14 @@ public function preIn(Manager $assets)
}

/**
* inBound
*
* Method to be called on the way into the filter.
*
* If not already provided, this method will add a default
* Proem\Api\Dispatch\Template implementation to the main service
* manager under the index of *dispatch*.
*
* @see Proem\Api\Dispatch\Template
* @param Proem\Api\Service\Manager\Template
*/
public function inBound(Manager $assets)
{
Expand All @@ -86,9 +95,13 @@ public function inBound(Manager $assets)
}

/**
* postIn
* Called after outBound.
*
* This method is reponsible for executing the DispatchStage process.
*
* Called after outBound
* @see Proem\Api\Dispatch\Stage
* @param Proem\Api\Service\Manager\Template
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap post.in.dispatch
*/
public function postIn(Manager $assets)
{
Expand All @@ -103,14 +116,14 @@ public function postIn(Manager $assets)
]);
}

// Dispatch to userland.
(new DispatchStage($assets));
}

/**
* preOut
* Called prior to outBound.
*
* Called prior to outBound
* @param Proem\Api\Service\Manager\Template
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap pre.out.dispatch
*/
public function preOut(Manager $assets)
{
Expand All @@ -127,19 +140,20 @@ public function preOut(Manager $assets)
}

/**
* outBound
*
* Method to be called on the way out of the filter.
*
* @param Proem\Api\Service\Manager\Template
*/
public function outBound(Manager $assets)
{

}

/**
* postOut
* Called after outBound.
*
* Called after outBound
* @param Proem\Api\Service\Manager\Template
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap post.out.dispatch
*/
public function postOut(Manager $assets)
{
Expand Down
40 changes: 22 additions & 18 deletions lib/Proem/Api/Bootstrap/Filter/Event/Request.php
Expand Up @@ -37,20 +37,19 @@
Proem\Filter\Event\Generic as Event;

/**
* Proem\Api\Bootstrap\Filter\Event\Request
*
* The default "Request" filter event.
*/
class Request extends Event
{
/**
* preIn
*
* Called prior to inBound
* Called prior to inBound.
*
* The preIn Filter event will trigger a pre.in.request Signal.
* A listener responding with an object that implements the
* Proem\Api\IO\Request\Template interface will result in that object
* being placed within the service manager under the *request* index.
*
* If this Signal returns a Proem\IO\Http\Request object load it into the Asset Manager.
* @param Proem\Api\Service\Manager\Template $assets
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap pre.in.request
*/
public function preIn(Manager $assets)
{
Expand All @@ -71,11 +70,13 @@ public function preIn(Manager $assets)
}

/**
* inBound
*
* Method to be called on the way into the filter.
*
* Checks to see if we already have an Asset providing Proem\IO\Http\Request, if not, we provide one.
* If not already provided this method will add a default
* Proem\Api\IO\Request\Template implementation to the service manager
* under the index of *request*.
*
* @param Proem\Api\Service\Manager\Template $assets
*/
public function inBound(Manager $assets)
{
Expand All @@ -91,9 +92,10 @@ public function inBound(Manager $assets)
}

/**
* postIn
* Called after outBound.
*
* Called after outBound
* @param Proem\Api\Service\Manager\Template $assets
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap post.in.request
*/
public function postIn(Manager $assets)
{
Expand All @@ -110,9 +112,10 @@ public function postIn(Manager $assets)
}

/**
* preOut
* Called prior to outBound.
*
* Called prior to outBound
* @param Proem\Api\Service\Manager\Template $assets
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap pre.out.request
*/
public function preOut(Manager $assets)
{
Expand All @@ -129,19 +132,20 @@ public function preOut(Manager $assets)
}

/**
* outBound
*
* Method to be called on the way out of the filter.
*
* @param Proem\Api\Service\Manager\Template $assets
*/
public function outBound(Manager $assets)
{

}

/**
* postOut
* Called after outBound.
*
* Called after outBound
* @param Proem\Api\Service\Manager\Template $assets
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap post.out.request
*/
public function postOut(Manager $assets)
{
Expand Down
46 changes: 28 additions & 18 deletions lib/Proem/Api/Bootstrap/Filter/Event/Response.php
Expand Up @@ -37,20 +37,20 @@
Proem\Filter\Event\Generic as Event;

/**
* Proem\Api\Bootstrap\Filter\Event\Response
*
* The default "Response" filter event.
*/
class Response extends Event
{
/**
* preIn
*
* Called prior to inBound
* Called prior to inBound.
*
* The preIn Filter event will trigger a pre.in.response Signal.
* A listener responding with an object implementing the
* Proem\Api\IO\Response\Template interface, will result in that
* object being placed within the main service manager under
* the index of *response*.
*
* If this Signal returns a Proem\IO\Http\Response object load it into the Asset Manager.
* @param Proem\Api\Service\Manager\Template $assets
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap pre.in.response
*/
public function preIn(Manager $assets)
{
Expand All @@ -71,11 +71,13 @@ public function preIn(Manager $assets)
}

/**
* inBound
*
* Method to be called on the way into the filter.
*
* Checks to see if we already have an Asset providing Proem\IO\Http\Response, if not, we provide one.
* If not already provided, this method will add a default
* Proem\Api\IO\Response\Template implementation to the main service
* manager under the index of *response*.
*
* @param Proem\Api\Service\Manager\Template $assets
*/
public function inBound(Manager $assets)
{
Expand All @@ -91,9 +93,10 @@ public function inBound(Manager $assets)
}

/**
* postIn
* Called after outBound.
*
* Called after outBound
* @param Proem\Api\Service\Manager\Template $assets
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap post.in.response
*/
public function postIn(Manager $assets)
{
Expand All @@ -110,9 +113,10 @@ public function postIn(Manager $assets)
}

/**
* preOut
* Called prior to outBound.
*
* Called prior to outBound
* @param Proem\Api\Service\Manager\Template $assets
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap pre.out.response
*/
public function preOut(Manager $assets)
{
Expand All @@ -129,9 +133,14 @@ public function preOut(Manager $assets)
}

/**
* outBound
*
* Method to be called on the way out of the filter.
*
* This method is responseible for sending the response
* to the client.
*
* @see Proem\Api\IO\Response\Template
* @param Proem\Api\Service\Manager\Template $assets
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap pre.in.response
*/
public function outBound(Manager $assets)
{
Expand All @@ -141,9 +150,10 @@ public function outBound(Manager $assets)
}

/**
* postOut
* Called after outBound.
*
* Called after outBound
* @param Proem\Api\Service\Manager\Template $assets
* @triggers Proem\Api\Bootstrap\Signal\Event\Bootstrap post.out.response
*/
public function postOut(Manager $assets)
{
Expand Down

0 comments on commit 6862067

Please sign in to comment.