LoginSignup
10
11

More than 5 years have passed since last update.

oilを実行したPHPで、PHPUnitを実行する

Posted at

phpenvでインストールしたPHPを使用していて、
PhpStorm経由で「oil test」を実行していたら、
PATHの関係で、oilを実行するPHPとPHPUnitを実行するPHPが異なってしまう場合があった。

・oilの実行PHP
/Users/Uchiko/.phpenv/versions/5.5.15/bin/php

・phpunitの実行PHP
/usr/bin/php

のような感じで。

対策として、
oil.php内のphpunit.binary_pathで、
oilで実行しているPHPのパスをPHP_BINARYで取得し、
phpunitの実行PHPを明示的に指定することによって、
この問題を回避した。

fuel/app/config/oil.php
<?php
return array(
    'phpunit' => array(
        'autoload_path' => 'PHPUnit/Autoload.php',
        'binary_path' => PHP_BINARY . ' fuel/vendor/bin/phpunit',
    ),
);
10
11
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
10
11