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
{ | |
"name": "phpunit", | |
"description": "PHPUnit Composer Package", | |
"require": { | |
"phpunit/phpunit": "3.7.*" | |
}, | |
"config": { | |
"bin-dir": "/usr/local/bin/" | |
} | |
} |
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
{ | |
"name": "your-name/your-project", | |
"require": { | |
"php": ">=5.3.2" | |
}, | |
"require-dev": { | |
"mockery/mockery": "dev-master@dev", | |
"hamcrest/hamcrest": "1.1.0" | |
}, | |
"repositories": [ |
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
function testsbygroup(){ | |
# Grab a list of groups | |
groups=`phpunit --list-groups | sed -rn 's/ - (.+)/\1/p'` | |
if [[ ! $groups ]]; then | |
return 1 | |
fi | |
# Set up some empty arrays | |
pass=() | |
incomplete=() |
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
curl https://github.com/WordPress/WordPress/compare/3.5...3.5.1.patch | patch -p1 |
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 | |
class Loopable_Query extends WP_Query implements Iterator { | |
/** | |
* (PHP 5 >= 5.0.0)<br/> | |
* Return the current element | |
* @link http://php.net/manual/en/iterator.current.php | |
* @return mixed Can return any type. | |
*/ |
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 | |
function remove_filter_by_classname( $filter, $classname, $priority ) { | |
global $wp_filter; | |
$match = false; | |
if( !empty( $wp_filter[$filter] ) && !empty( $wp_filter[$filter][$priority] ) ) { | |
foreach( $wp_filter[$filter][$priority] as $added_filter ) { | |
if( is_array( $added_filter['function'] ) && get_class( $added_filter['function'][0] ) === $classname ) { | |
$match = $added_filter; | |
break; |
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 Alpha\Beta\Gamma\Base\Echo; | |
use Alpha\Beta\Gamma\Base; | |
class Foxtrot extends Base\Echo | |
{ | |
} |
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 | |
add_action('current_screen', 'jpb_current_screen'); | |
/** | |
* @param WP_Screen $screen The current screen object | |
*/ | |
function jpb_current_screen($screen){ | |
if($screen->post_type === 'my_custom_post_type'){ | |
$screen->add_help_tab(array( |
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 | |
class Foo { | |
private $bar; | |
public function __construct($bar){ | |
$this->bar = $bar; | |
} | |
} |