Skip to content

Instantly share code, notes, and snippets.

View ezzatron's full-sized avatar

Erin ezzatron

View GitHub Profile
@ezzatron
ezzatron / 0-overview.md
Last active August 29, 2015 14:03
Benchmarking new PHPUnit annotation resolution against the Symfony 2 test suite

Benchmarking new PHPUnit annotation resolution against the Symfony 2 test suite

Host machine

  • 27" iMac, late 2013
  • 3.2 GHz Intel Core i5
  • 8 GB 1600 MHz DDR3
  • PHP memory_limit of 128MB

Summary of runs

@ezzatron
ezzatron / 0-overview.md
Last active August 29, 2015 14:03
Benchmarking new PHPUnit annotation resolution against the sebastian/money test suite

Benchmarking new PHPUnit annotation resolution against the sebastian/money test suite

Host machine

  • 15" MacBook Pro Retina, Late 2013
  • 2.3 GHz Intel Core i7
  • 16 GB 1600 MHz DDR3
  • PHP memory_limit of 128MB

Summary of runs

@ezzatron
ezzatron / 0-overview.md
Created July 8, 2014 04:14
Benchmarking new PHPUnit annotation resolution against the sebastian/money test suite (round 2)

Benchmarking new PHPUnit annotation resolution against the sebastian/money test suite (round 2)

Host machine

  • 27" iMac, late 2013
  • 3.2 GHz Intel Core i5
  • 8 GB 1600 MHz DDR3
  • PHP memory_limit of 128MB

Summary of runs

@ezzatron
ezzatron / Vagrantfile
Last active August 29, 2015 14:07
HHVM CLI test box
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "hashicorp/precise64"
config.vm.provision "shell", inline: <<-shell
echo "Installing apt packages"
apt-get install curl git python-software-properties screen vim -y --force-yes
echo "Installing HHVM"
@ezzatron
ezzatron / gist:1c9ce238bd7ef6a054b2
Created October 29, 2014 01:27
Test runner syntax ideas
<?php
/*
* This file is part of the Phony package.
*
* Copyright © 2014 Erin Millard
*
* For the full copyright and license information, please view the LICENSE file
* that was distributed with this source code.
*/
@ezzatron
ezzatron / wildmatch.php
Last active August 29, 2015 14:15
Port of Git wildmatch to PHP
<?php
const WM_CASEFOLD = 1;
const WM_PATHNAME = 2;
const WM_ABORT_MALFORMED = 2;
const WM_NOMATCH = 1;
const WM_MATCH = 0;
const WM_ABORT_ALL = -1;
const WM_ABORT_TO_STARSTAR = -2;
@ezzatron
ezzatron / StringTest.php
Created April 30, 2011 04:16
Situation where programmatic @Covers could be used in PHPUnit
<?php
namespace Typhoon\Type;
class StringTest extends \Typhoon\Test\TypeTestCase
{
protected function typeFixture()
{
return new String;
}
@ezzatron
ezzatron / ExceptionTest.php
Created May 3, 2011 03:33
Example of using a test fixture method in a PHPUnit test case base class
<?php
namespace Typhoon\Exception;
use Typhoon\Primitive\String;
use Typhoon\Test\ExceptionTestCase;
class ExceptionTest extends ExceptionTestCase
{
/**
@ezzatron
ezzatron / After.php
Created May 9, 2011 09:51
Scisr clean-use
<?php
namespace Foo;
use Bar\Baz\Qux;
use Bar\Baz\Splat;
class Donk
{
public function foo(Qux $qux) {}
@ezzatron
ezzatron / clean-use.php
Created May 9, 2011 12:10
Script to clean unnecessary PHP use statements
#!/usr/bin/env php
<?php
$paths = array();
if (isset($_SERVER['argv']))
{
$paths = $_SERVER['argv'];
array_shift($paths);
if (!$paths)