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
if [ ! -e "$IPATH/iTunesX" ]
sudo mv "$IPATH/iTunes" "$IPATH/iTunesX"
# has sudo failed?
if (( $? ))
everzet / symfony1VsZfCodingStyleGuides.php
Created May 12, 2010
Readability issues in ZF vs symfony 1 style guides
View symfony1VsZfCodingStyleGuides.php
// ZF coding style guides
public function hydrate(ClassMetadata $metadata, $document, $data)
$values = array();
foreach ($metadata->fieldMappings as $mapping) {
if ( ! isset($data[$mapping['fieldName']])) {
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
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);
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 / behat_steps.php
Created Feb 13, 2011
how to make verbose "equals" assertions in Behat with PHPUnit
View behat_steps.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);
View new_study.feature
Feature: New Study
In order to create a new Study
As a Researcher
I must be able to enter information about the study and save it
Scenario Outline: Researcher adds new study
When I enter <study name>
And I enter <short url>
And I enter <welcome text>
And I set self registration to <self registration>
everzet / symfony_resource_watcher.php
Created Mar 25, 2011
New ResourceWatcher component demonstration
View symfony_resource_watcher.php
use Symfony\Component\ResourceWatcher\ResourceWatcher,
$watcher = new ResourceWatcher();
$watcher->track(new DirectoryResource('/some/directory'), function($event) {
everzet / http_api.feature
Created Apr 22, 2011
REST API feature example
View http_api.feature
Feature: REST API
In order to be able to build my own tool for web application
As a developer
I need to have clean REST API for application
Scenario: List all users
Given application has users:
| name | email |
| ivan | |
| dima | |
everzet / config_dev.yml
Created Apr 27, 2011
Enabling BehatBundle
View config_dev.yml
test: ~
start_url: http://your_app_local.url/app_dev.php/
behat: ~
You can’t perform that action at this time.