Skip to content

Commit

Permalink
namespacing behat contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
dav-m85 committed Jun 1, 2017
1 parent a107644 commit d0c1106
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 15 deletions.
4 changes: 2 additions & 2 deletions behat.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default:
features: features
bootstrap: %behat.paths.features%/contexts
context:
class: FeatureContext
class: Silo\Context\FeatureContext
parameters:
debugDoctrine: false
coverage: false
Expand All @@ -13,7 +13,7 @@ coverage:
features: features
bootstrap: %behat.paths.features%/contexts
context:
class: FeatureContext
class: Silo\Context\FeatureContext
parameters:
debugDoctrine: false
coverage: true
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
},
"autoload": {
"psr-4": {
"Silo\\": "server"
"Silo\\": "server",
"Silo\\Context\\": "features/contexts"
}
}
}
2 changes: 2 additions & 0 deletions features/contexts/AppAwareContextInterface.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Silo\Context;

interface AppAwareContextInterface
{
public function setApp(\Silex\Application $app);
Expand Down
2 changes: 2 additions & 0 deletions features/contexts/CoverageContext.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Silo\Context;

use \Behat\Behat\Context\BehatContext;

class CoverageContext extends BehatContext
Expand Down
14 changes: 2 additions & 12 deletions features/contexts/FeatureContext.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,12 @@
<?php

namespace Silo\Context;

use Behat\Behat\Context\BehatContext;
use Behat\Gherkin\Node\TableNode;
use Doctrine\Common\Collections\ArrayCollection;
use Silo\Inventory\Model as Inventory;

//
// Require 3rd-party libraries here:
//
// require_once 'PHPUnit/Autoload.php';
// require_once 'PHPUnit/Framework/Assert/Functions.php';
//
require_once __DIR__.'/CoverageContext.php';
require_once __DIR__.'/ThenContext.php';
require_once __DIR__.'/UnitContext.php';
require_once __DIR__.'/SilexContext.php';
require_once __DIR__.'/PrintDebugLogger.php';

/**
* Features context.
*/
Expand Down
2 changes: 2 additions & 0 deletions features/contexts/PrintDebugLogger.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Silo\Context;

class PrintDebugLogger implements \Doctrine\DBAL\Logging\SQLLogger
{
private $context;
Expand Down
3 changes: 3 additions & 0 deletions features/contexts/SilexContext.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
<?php

namespace Silo\Context;

use Behat\Behat\Context\BehatContext;
use Symfony\Component\HttpKernel\Client;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\TableNode;
use Silo\Context\AppAwareContextInterface;

/**
* @see Silex\WebTestCase
Expand Down
2 changes: 2 additions & 0 deletions features/contexts/ThenContext.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Silo\Context;

use \Behat\Behat\Context\BehatContext;
use Behat\Gherkin\Node\TableNode;
use Doctrine\Common\Collections\ArrayCollection;
Expand Down
2 changes: 2 additions & 0 deletions features/contexts/UnitContext.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

namespace Silo\Context;

use Behat\Behat\Context\BehatContext;
use Silo\Inventory\Model as Inventory;

Expand Down

0 comments on commit d0c1106

Please sign in to comment.