This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class TestCase extends \PHPUnit_Framework_TestCase | |
{ | |
protected function tearDown() | |
{ | |
parent::tearDown(); | |
\Mockery::close(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace English; | |
/** | |
* Class English\Inflect for pluralizing/singularizing english words. | |
* | |
* Thanks to http://www.eval.ca/articles/php-pluralize (MIT license) | |
* http://dev.rubyonrails.org/browser/trunk/activesupport/lib/active_support/inflections.rb (MIT license) | |
* http://www.fortunecity.com/bally/durrus/153/gramch13.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Nette\Application\Responses; | |
use Nette; | |
/** | |
* CSV download response. | |
* Under New BSD license. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
abstract class TestCase extends \PHPUnit_Framework_TestCase | |
{ | |
protected function assertException(callable $callback, $expectedException = 'Exception', $expectedCode = null, $expectedMessage = null) | |
{ | |
$expectedException = ltrim((string) $expectedException, '\\'); | |
if (!class_exists($expectedException) && !interface_exists($expectedException)) { | |
$this->fail(sprintf('An exception of type "%s" does not exist.', $expectedException)); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
set phpunit="C:/path/to/phpunit.phar" | |
if a%1==a goto noargs | |
if a%2==a goto noargs | |
if a%3==a-x goto xdebug | |
php %phpunit% -c %1 %2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rem if executed at a weekday between 5 AM and 11 AM, it will start working applications | |
@echo off | |
cls | |
rem set your apps: | |
set myapp0=C:\your\app\number\one.exe | |
set myapp1=C:\another\app.exe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* OpenObject let you access even protected and private properties and methods. | |
* It may be helpful for testing purposes. | |
*/ | |
class OpenObject | |
{ | |
/** @var object */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Texas Hold'em Poker class | |
*/ | |
require_once 'functions.php'; | |
class poker{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace LazyDataMapper; | |
use Nette\Caching\IStorage; | |
use Nette\Caching\Cache as NetteCache; | |
class Cache implements IExternalCache | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Case-insensitive realpath() | |
* @param string $path | |
* @return string|false | |
*/ | |
function realpathi($path) | |
{ | |
$me = __METHOD__; |
OlderNewer