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 staticReturn() | |
{ | |
if(isset($static_user)) | |
{ | |
return $static_user; | |
} | |
$user = fetchUser(); | |
static $static_user = $user; |
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 get_menu_items( $menu_name ) { | |
if( !$menu_name ) | |
return false; | |
if( ( $locations = get_nav_menu_locations() ) && isset( $locations[$menu_name] ) ) { | |
$menu = wp_get_nav_menu_object( $locations[$menu_name] ); | |
$menu_items = wp_get_nav_menu_items( $menu->term_id ) ; | |
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 Helper; | |
use Codeception\Util\JsonType; | |
class Unit extends \Codeception\Module | |
{ | |
public function assertMatchesTypes(array $types, array $data, $message = null) | |
{ | |
$jsonType = new JsonType($data); |
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
var env = require('node-env-file'); | |
env(__dirname + '/../.env'); | |
const botkitHelper = require('@naktibalda/testmybot/helper/botkit'); | |
const mochaHelper = require('@naktibalda/testmybot/helper/mocha'); | |
const Botkit = require('botkit'); | |
const bot = require('../build/bot.js').default; | |
const controller = Botkit.facebookbot({access_token: 'test', verify_token: 'test'}); |
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 | |
$descriptors = [ | |
0 => ["pipe", "r"], // stdin is a pipe that the child will read from | |
1 => ["pipe", "w"], // stdout is a pipe that the child will write to | |
2 => ["pipe", "w"], // stderr is a file to write to | |
]; | |
$pipes = []; | |
$command = 'perl test.pl'; | |
$process = proc_open($command, $descriptors, $pipes); |