Skip to content

Instantly share code, notes, and snippets.

Konstantin Kudryashov everzet

Block or report user

Report or block everzet

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@everzet
everzet / gherkin_usage.php
Last active Aug 29, 2015
Usage of Behat\Gherkin 2.3
View gherkin_usage.php
<?php
$keywords = new Behat\Gherkin\Keywords\CachedArrayKeywords('/path/to/gherkin_lib/i18n.php');
$lexer = new Behat\Gherkin\Lexer($keywords);
$parser = new Behat\Gherkin\Parser($lexer);
$gherkin = new Behat\Gherkin();
$gherkin->addLoader(new Behat\Gherkin\Loader\DirectoryLoader($gherkin));
$gherkin->addLoader(new Behat\Gherkin\Loader\GherkinFileLoader($parser));
$gherkin->setBasePath(__DIR__ . '/features');
View RegistrationContext.php
<?php
use Behat\Behat\Context\Context;
namespace Context;
class RegistrationContext implements Context
{
/**
* @When I go to the registration page
View ESContext.php
<?php
class ESContext
{
/**
* @Given a conference named :name with :count track(s) was scheduled
*/
public function aConferenceNamedWithTrack($name, $count)
{
$this->dispatchEvent(ConferenceNamedWithTracksWasScheduled($name, $count));
View keybase.md

Keybase proof

I hereby claim:

  • I am everzet on github.
  • I am everzet (https://keybase.io/everzet) on keybase.
  • I have a public key whose fingerprint is E906 3994 7D23 C4AA C736 6CD5 773E 4529 CE27 777F

To claim this, I am signing this object:

View iPatch.sh
#!/bin/bash
IPATH="/Applications/iTunes.app/Contents/MacOS"
if [ ! -e "$IPATH/iTunesX" ]
then
sudo mv "$IPATH/iTunes" "$IPATH/iTunesX"
# has sudo failed?
if (( $? ))
@everzet
everzet / symfony1VsZfCodingStyleGuides.php
Created May 12, 2010
Readability issues in ZF vs symfony 1 style guides
View symfony1VsZfCodingStyleGuides.php
<?php
// ZF coding style guides
public function hydrate(ClassMetadata $metadata, $document, $data)
{
$values = array();
foreach ($metadata->fieldMappings as $mapping) {
if ( ! isset($data[$mapping['fieldName']])) {
continue;
View gist:478885
Feature: Homepage
Scenario: Index page
Given I am on homepage
When I go to main/index
Then Response status code is 200
And I should see "This is a temporary page"
#--------------------------------------------------------------
View sahi_driver.example.php
<?php
require_once '/sahi/driver/path/autoload.php.dist';
use Everzet\SahiDriver;
$connection = new SahiDriver\Connection('@@SAHI_SESSION_ID@@'); // replace with your custom session ID
$browser = new SahiDriver\Browser($connection);
$browser->navigateTo('http://shopopensky.com/');
@everzet
everzet / rspec_in_php.rb
Created Dec 14, 2010
Explanation in examples why PHP will never have RSpec-like behavioral unit tests
View rspec_in_php.rb
# RSpec (aka "Best in Ruby"):
@account.balance.should == 12
# PHPUnit (aka "Best in PHP"):
$this->assertEquals(12, $account->getBalance());
# PHPSpec:
@everzet
everzet / behat_steps.php
Created Feb 13, 2011
how to make verbose "equals" assertions in Behat with PHPUnit
View behat_steps.php
<?php
$steps->Then('/^it should pass with:$/', function($world, $data) {
try {
assertEquals((string) $data, $world->output);
} catch (\Exception $e) {
$exceptionDiff = \PHPUnit_Framework_TestFailure::exceptionToString($e);
throw new \Exception($exceptionDiff, $e->getCode(), $e);
}
});
You can’t perform that action at this time.