-
Notifications
You must be signed in to change notification settings - Fork 276
Xdebug support in PHPStorm #282
base: master
Are you sure you want to change the base?
Changes from 8 commits
87732a6
ed53591
89a5c7c
5005c1b
ea815b1
e4a3989
fde2070
0d9524c
914a018
4831d53
b4325e1
db9516a
9eae501
a037047
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ | |
*.phar | ||
composer.lock | ||
vendor | ||
.idea | ||
behat.yml |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,48 @@ | ||
{ | ||
"name": "behat/mink-extension", | ||
"type": "behat-extension", | ||
"description": "Mink extension for Behat", | ||
"keywords": ["web", "test", "browser", "gui"], | ||
"homepage": "http://extensions.behat.org/mink", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Konstantin Kudryashov", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "Christophe Coevoet", | ||
"email": "[email protected]" | ||
} | ||
], | ||
|
||
"require": { | ||
"php": ">=5.3.2", | ||
"behat/behat": "~3.0,>=3.0.5", | ||
"behat/mink": "~1.5", | ||
"symfony/config": "~2.2|~3.0" | ||
"name": "behat/mink-extension", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please don't change the indentation of the file |
||
"type": "behat-extension", | ||
"description": "Mink extension for Behat", | ||
"keywords": [ | ||
"web", | ||
"test", | ||
"browser", | ||
"gui" | ||
], | ||
"homepage": "http://extensions.behat.org/mink", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Konstantin Kudryashov", | ||
"email": "[email protected]" | ||
}, | ||
|
||
"require-dev": { | ||
"phpspec/phpspec": "~2.0", | ||
"behat/mink-goutte-driver": "~1.1" | ||
}, | ||
|
||
"autoload": { | ||
"psr-0": { "Behat\\MinkExtension": "src/" } | ||
}, | ||
|
||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "2.1.x-dev" | ||
} | ||
{ | ||
"name": "Christophe Coevoet", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": ">=5.3.2", | ||
"behat/behat": "~3.0,>=3.0.5", | ||
"behat/mink": "~1.5", | ||
"symfony/config": "~2.2|~3.0" | ||
}, | ||
"require-dev": { | ||
"phpspec/phpspec": "~2.0", | ||
"behat/mink-goutte-driver": "~1.1" | ||
}, | ||
"autoload": { | ||
"psr-0": { | ||
"Behat\\MinkExtension": "src/" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Behat\\MinkExtension\\Tests\\": "features/src" | ||
} | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "2.1.x-dev" | ||
} | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
|
||
namespace Behat\MinkExtension\Tests; | ||
|
||
use Behat\Mink\Exception\ExpectationException; | ||
use Behat\MinkExtension\Context\RawMinkContext; | ||
|
||
/** | ||
* Feature context for testing advanced scenarios. | ||
*/ | ||
class FeatureContext extends RawMinkContext | ||
{ | ||
|
||
/** | ||
* @BeforeScenario @MockXdebug | ||
*/ | ||
public function setUpXdebugMock() | ||
{ | ||
$_SERVER['XDEBUG_CONFIG'] = 'xdebug'; | ||
} | ||
|
||
/** | ||
* @Then /^I should have the "([^"]*)" cookie with value "([^"]*)"$/ | ||
*/ | ||
public function iShouldHaveTheCookieWithValue($cookie_name, $cookie_expected_value) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please respect our coding standards. We use PSR-2, so variable names are camelCased, and the curly brace should go on the next line (as done for the previous method) |
||
if ($cookie_real_value = $this->getSession()->getCookie($cookie_name)) { | ||
if ($cookie_real_value !== $cookie_expected_value) { | ||
throw new ExpectationException( | ||
'The cookie with name ' . $cookie_name . ' was found, but does not contain ' . $cookie_real_value . ', yet it contains ' . $cookie_expected_value . '.', | ||
$this->getSession() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. passing the session in the constructor is deprecated. Please use the new API. Btw, you could use the Mink assertion API for this: |
||
); | ||
} | ||
} else { | ||
throw new ExpectationException( | ||
'The cookie with name ' . $cookie_name . ' was not found', | ||
$this->getSession() | ||
); | ||
} | ||
} | ||
|
||
/** | ||
* @Then /^I should not have the "([^"]*)" cookie$/ | ||
*/ | ||
public function iShouldNotHaveTheCookie($cookie_name) | ||
{ | ||
if ($cookie_real_value = $this->getSession()->getCookie($cookie_name)) { | ||
throw new ExpectationException( | ||
'The cookie with name ' . $cookie_name . ' was not found, but it should not be present.', | ||
$this->getSession() | ||
); | ||
} | ||
} | ||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
Feature: Xdebug | ||
In order to properly develop with BDD | ||
As a feature developer | ||
I need to be able to use my debugger | ||
|
||
Scenario: Xdebug cookie should not be present on normal requests | ||
Given I am on "/wiki/Main_Page" | ||
Then I should not have the "XDEBUG_SESSION" cookie | ||
|
||
@MockXdebug | ||
Scenario: Xdebug cookie should be passed on to requests | ||
Given I am on "/wiki/Main_Page" | ||
Then I should have the "XDEBUG_SESSION" cookie with value "xdebug" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one must be removed. It is specific to your system, not to the project, so it should not be added in the project-level ignore rules. See https://help.github.com/articles/ignoring-files/ to know how to ignore it on your system