PHPユーザーであれば、PHPが標準で持つ多くの内部(ビルトイン)関数や定数には日常的にお世話になっていることでしょう。これらの内部関数・定数はPHPの便利さの象徴といえます。しかし、内部関数や定数の使用はテストのしやすさを低下させる原因となります。以下のコードを見てみましょう。 <?php ... class CollectingType { protected $type; protected $expectedSuperTypes = array(); ... public function isTest() { if (in_array($this->type, $this->expectedSuperTypes)) { return false; } else { foreach ($this->expectedSuperTypes as $expectedSuperType)