Skip to content

Instantly share code, notes, and snippets.

View morozov's full-sized avatar

Sergei Morozov morozov

View GitHub Profile
<?php
/**
* @requires function non_existing_function
* @see http://phpunit.de/manual/3.7/en/incomplete-and-skipped-tests.html#incomplete-and-skipped-tests.requires.tables.api
*/
class RequiresTest extends PHPUnit_Framework_TestCase
{
public static function setUpBeforeClass()
{
@morozov
morozov / benchmark.p
Last active December 27, 2015 05:59
SugarCRM on HHVM Benchmarking
# output as png image
set terminal png size 1280,800
set output "benchmark.png"
set title "SugarCRM Benchmarking"
# y-axis grid
set grid y
# x-axis label
@morozov
morozov / README.md
Last active December 8, 2018 13:04
Ninja Test Qualification

Ninja Test Qualification

Ninja test is a self-sufficient unit test that is fully responsible for setting up environment it depends on and doesn't rely on other tests. Unlike others, ninja-tests survive within any test suite, they are less subjected to accidental false-negative failures and don't require periodical fixing.

In order to see if your newly written test passes the ninja qualification, to run it with the following command:

php phpunit.php --bootstrap=/path/to/ninja.php -c tests/phpunit.xml /path/to/test.php
@morozov
morozov / master.php
Last active December 17, 2015 18:49
Trying to setup communication by means of STDIO
<?php
function start_worker($id)
{
printf("starting worker: %s\n", $id);
$proc = proc_open(
'php worker.php ' . $id,
array(
array('pipe', 'r'),
array('pipe', 'w'),