Skip to content

Instantly share code, notes, and snippets.

@nojimage
Last active December 29, 2015 10:19
Show Gist options
  • Save nojimage/7655837 to your computer and use it in GitHub Desktop.
Save nojimage/7655837 to your computer and use it in GitHub Desktop.
netbeans custom phpunit script
#!/usr/bin/env php
<?php
$paths = array(
PHP_BINDIR,
'/usr/local/phpenv/shims',
getenv('PATH')
);
putenv('PATH=' . join(PATH_SEPARATOR, $paths));
array_shift($argv);
foreach ($argv as $idx => $arg) {
if (preg_match('/NetBeansSuite.php$/', $arg) && is_file(__DIR__ . DIRECTORY_SEPARATOR . 'NetBeansSuite.php')) {
$arg = __DIR__ . DIRECTORY_SEPARATOR . 'NetBeansSuite.php';
}
$argv[$idx] = escapeshellarg($arg);
}
$args = join(' ', $argv);
passthru('XDEBUG_CONFIG="idekey=netbeans-xdebug" phpunit ' . $args);
@nojimage
Copy link
Author

phpインタプリタの指定を .phpenv/shims/php にすれば、これでいけるぽぃ。
/opt/local/binをパスに追加しているのは、macportsのphpがあるため。

@nojimage
Copy link
Author

xDebugに対応

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment