Fully-qualified name

How can I test code that uses a fully-qualified name?

src/Shell.php
<?php namespace Example; use DateTime; class Shell { public function run($command) { \shell_exec($command); } }

Add it to your list of side effects:

lens/tests/Shell.php
<?php namespace Example; // Test $shell = new Shell(); $shell->run('whoami'); // Effect shell_exec('whoami'); // return 'user'; // Effect shell_exec('whoami'); // return 'root';

Download this example