Skip to content

Instantly share code, notes, and snippets.

View cordoval's full-sized avatar

Luis Cordova cordoval

View GitHub Profile
rep:
pattern: /rep
defaults: { _controller: AwareSales:Rep:index }
sale_main:
pattern: /sale/
defaults: { _controller: AwareSales:Sale:index }
sale_new:
pattern: /sale/new
in my controller:
--------------------
$form = SalesForm::create($this->get('form.context'), 'sale', array('em' => $em));
in my SalesForm:
--------------------
class SalesForm extends Form
{
<?php
/*
* based on FOS\UserBundle\Entity
*/
namespace HBK\ScavengerHuntBundle\Entity;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Events;
@cordoval
cordoval / FeatureContext.php
Created August 13, 2011 19:17 — forked from everzet/FeatureContext.php
How to use MinkContext inside BehatBundle as subcontext
<?php
namespace Acme\DemoBundle\Features\Context;
use Behat\BehatBundle\Context\BehatContext,
Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
/**
@cordoval
cordoval / FeatureContext.php
Created August 13, 2011 22:21 — forked from everzet/FeatureContext.php
How to use MinkContext inside BehatBundle as subcontext
<?php
namespace Acme\DemoBundle\Features\Context;
use Behat\BehatBundle\Context\BehatContext,
Behat\Behat\Exception\PendingException;
use Behat\Gherkin\Node\PyStringNode,
Behat\Gherkin\Node\TableNode;
/**
@cordoval
cordoval / Usage.php
Created September 9, 2011 02:34 — forked from jjbohn/Usage.php
<?php
class DescribeIndex extends View
{
function itRendersTheSelectedVideo()
{
$video = \Mockery::mock(
'Application_Model_Video', array('getName' => 'Revolution OS'));
$output = $this->render('MyBundle:Video:detail.html.twig', array(
@cordoval
cordoval / bdd-experiment-guide.md
Created September 9, 2011 16:38 — forked from havvg/bdd-experiment-guide.md
Behavior Driven Development in Symfony2 with Behat, Mink and Zombie.js

Description

This guide will show how to setup a new web application project with:

  • git, a distributed version control system.
  • Symfony2 framework
  • Behat, a tool for behavior driven development.
  • Mink, a tool unifying access to browser emulators wrapping them into one API.
  • Zombie.js, a browser emulator.
  • PHPUnit, the de-facto standard test suite in the PHP world.
@cordoval
cordoval / zombie.js
Created September 13, 2011 14:41 — forked from havvg/zombie.js
var net = require('net');
var sys = require('sys');
var zombie = require('zombie');
var browser = null;
var pointers = [];
var buffer = "";
net.createServer(function (stream) {
stream.setEncoding('utf8');
stream.allowHalfOpen = true;
@cordoval
cordoval / git-world.rb
Created September 15, 2011 05:01 — forked from SethMilliken/git-world.rb
git command to apply same command to multiple work trees
#!/usr/bin/env ruby
require 'open3'
include Open3
# TODO: use colors in output
def gitworld(command)
home = ENV["HOME"]
paths = [ \
"", \
@cordoval
cordoval / minesweeper_functional_kata.php
Created September 16, 2011 08:59
Spike for functionally solving MineSweeper Kata
<?php
$grid = array(
array('*', '*', '*', '*', '*'),
array('*', '.', '*', '.', '*'),
array('*', '*', '.', '.', '*'),
array('*', '*', '.', '*', '*'),
array('*', '*', '*', '*', '*')
);