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
<?php | |
// how that: | |
class DescribeContextZend extends PHPSpec_Context | |
{ | |
public function itShouldSetControllerNameUsingContextClass() | |
{ | |
$context = new DescribeFooController; | |
$this->spec($context->getController())->should->be('Foo'); |
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
<?php | |
/* | |
Why i think, that "RSpec is not possible in PHP"? | |
Cuz Ruby's syntax abilities can represent | |
natural language constructions: | |
object should equals 2 |
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
<?php | |
/* | |
You can't use classes like this to define steps by the simple reason: | |
in Behat and Cucumber, step definitions and test contexts ARE two | |
splitted logical elements, not one. Different step definitions | |
can be used together in different scenarios and each scenario will | |
have it's own context (environment) object. That's the main logical | |
idea behind Behat - define step once - use it everywhere. |
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
<?php | |
public function registerBundles() | |
{ | |
// ... | |
if ('test' === $this->getEnvironment()) { | |
$bundles[] = new Behat\MinkBundle\BehatMinkBundle(); | |
$bundles[] = new Behat\BehatBundle\BehatBundle(); | |
} | |
// ... |
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
<?php | |
namespace Acme\DemoBundle\Features\Context; | |
use Behat\BehatBundle\Context\BehatContext, | |
Behat\Behat\Exception\PendingException; | |
use Behat\Gherkin\Node\PyStringNode, | |
Behat\Gherkin\Node\TableNode; | |
/** |
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
require 'formula' | |
def mysql_installed? | |
`which mysql_config`.length > 0 | |
end | |
class Php < Formula | |
url 'http://www.php.net/get/php-5.3.8.tar.gz/from/this/mirror' | |
homepage 'http://php.net/' | |
md5 'f4ce40d5d156ca66a996dbb8a0e7666a' |
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
<?php | |
use Behat\Mink\Behat\Context\MinkContext; | |
/** | |
* Provides basic steps to test your web app from the geek perspective. | |
*/ | |
class GeekyMinkContext extends MinkContext | |
{ | |
/** |
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
<?php | |
$watcher = new Symfony\Component\ResourceWatcher\ResourceWatcher; | |
// track any change inside directory: | |
$watcher->track('some/folder1', function($event) { | |
echo '['.$event->getType().'] '.$event->getResource()."\n" | |
}); |
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
{ | |
"require": { | |
"behat/behat": ">=2.2.0" | |
} | |
} |
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
#!/bin/sh | |
wget http://selenium.googlecode.com/files/selenium-server-standalone-2.15.0.jar | |
jar xf selenium-server-standalone-2.15.0.jar core/scripts/atoms.js | |
ed -- "core/scripts/atoms.js" <<-PATCH | |
9423s|a.|XPCNativeWrapper(a).| | |
w | |
q | |
PATCH |