Skip to content

Instantly share code, notes, and snippets.

🙈
Living in 🇦🇪

Pablo Morales pablofmorales

🙈
Living in 🇦🇪
Block or report user

Report or block pablofmorales

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
View ConfigProvider Silex
<?php
namespace Providers;
use Silex\Application;
use Silex\ServiceProviderInterface;
use Symfony\Component\Yaml\Yaml;
class ConfigServiceProvider implements ServiceProviderInterface
{
@pablofmorales
pablofmorales / gist:4680373
Last active Dec 11, 2015
When I try to mock a class which use QueryBuilder :(
View gist:4680373
<?php
class TestTest extends \PHPUnit_Framework_TestCase
{
public function test_someAwfulTest()
{
$expected = array(array('name' => 'buenos aires'));
$connectionMock = $this->getMockBuilder('Doctrine\DBAL\Connection')
->disableOriginalConstructor()
->getMock();
View gist:5111270
require 'rspec'
require 'watir-webdriver'
browser = Watir::Browser.new
RSpec.configure do |config|
config.before(:each) { @browser = browser }
config.after(:suite) { browser.close unless browser.nil? }
end
View gist:5111309
require 'rspec'
require 'watir-webdriver'
browser = Watir::Browser.new
RSpec.configure do |config|
config.before(:each) { @browser = browser }
config.after(:suite) { browser.close unless browser.nil? }
end
@pablofmorales
pablofmorales / smoke.sh
Last active Dec 15, 2015
Smoke trigger
View smoke.sh
#!/bin/bash
RESULT=$(phpunit tests/Smoke);
if [[ $RESULT =~ FAILURES ]]; then
echo "THE TESTS FAILS"
echo $RESULT
exit 1;
fi
@pablofmorales
pablofmorales / CountryService.php
Created Apr 10, 2013
Ejemplo de uso de Validator
View CountryService.php
<?php
namespace Services;
use Models\CountryMapper;
use Billing\Services\ServiceValidator;
use Symfony\Component\Validator\Constraints\NotNull;
class Country
{
@pablofmorales
pablofmorales / gist:5503494
Created May 2, 2013
Smoke.sh para correr todo los tests de smoke, y comprobar rapidamente si debemos seguir con el deploy o tirar todo para atras.
View gist:5503494
#!/bin/bash
RESULT=$(phpunit tests/Smoke);
if [[ $RESULT =~ FAILURES ]]; then
echo "TEST WAS FAILED"
echo $RESULT
exit 1;
fi
You can’t perform that action at this time.