/tests/units/classes/runner.php

https://github.com/Calak/atoum · PHP · 673 lines · 552 code · 121 blank · 0 comment · 1 complexity · 8c229e04d82050a271390aea6dc3c522 MD5 · raw file

  1. <?php
  2. namespace mageekguy\atoum\tests\units;
  3. use
  4. mageekguy\atoum,
  5. mageekguy\atoum\mock
  6. ;
  7. require_once(__DIR__ . '/../runner.php');
  8. class runner extends atoum\test
  9. {
  10. public function testClass()
  11. {
  12. $this->assert
  13. ->testedClass
  14. ->hasInterface('mageekguy\atoum\observable')
  15. ->hasInterface('mageekguy\atoum\adapter\aggregator')
  16. ->string(atoum\runner::atoumVersionConstant)->isEqualTo('mageekguy\atoum\version')
  17. ->string(atoum\runner::atoumDirectoryConstant)->isEqualTo('mageekguy\atoum\directory')
  18. ->string(atoum\runner::runStart)->isEqualTo('runnerStart')
  19. ->string(atoum\runner::runStop)->isEqualTo('runnerStop')
  20. ;
  21. }
  22. public function test__construct()
  23. {
  24. $runner = new atoum\runner();
  25. $this->assert
  26. ->object($runner->getScore())->isInstanceOf('mageekguy\atoum\score')
  27. ->object($runner->getAdapter())->isInstanceOf('mageekguy\atoum\adapter')
  28. ->object($runner->getLocale())->isInstanceOf('mageekguy\atoum\locale')
  29. ->object($runner->getSuperglobals())->isInstanceOf('mageekguy\atoum\superglobals')
  30. ->variable($runner->getRunningDuration())->isNull()
  31. ->boolean($runner->codeCoverageIsEnabled())->isTrue()
  32. ->variable($runner->getDefaultReportTitle())->isNull()
  33. ;
  34. $runner = new atoum\runner($score = new atoum\score(), $adapter = new atoum\test\adapter());
  35. $this->assert
  36. ->object($runner->getScore())->isIdenticalTo($score)
  37. ->object($runner->getAdapter())->isIdenticalTo($adapter)
  38. ->object($runner->getLocale())->isInstanceOf('mageekguy\atoum\locale')
  39. ->object($runner->getSuperglobals())->isInstanceOf('mageekguy\atoum\superglobals')
  40. ->variable($runner->getRunningDuration())->isNull()
  41. ->boolean($runner->codeCoverageIsEnabled())->isTrue()
  42. ->variable($runner->getDefaultReportTitle())->isNull()
  43. ;
  44. }
  45. public function testSetAdapter()
  46. {
  47. $runner = new atoum\runner();
  48. $this->assert
  49. ->object($runner->setAdapter($adapter = new atoum\test\adapter()))->isIdenticalTo($runner)
  50. ->object($runner->getAdapter())->isIdenticalTo($adapter)
  51. ;
  52. }
  53. public function testSetSuperglobals()
  54. {
  55. $runner = new atoum\runner();
  56. $this->assert
  57. ->object($runner->setSuperglobals($superglobals = new atoum\superglobals()))->isIdenticalTo($runner)
  58. ->object($runner->getSuperglobals())->isIdenticalTo($superglobals);
  59. ;
  60. }
  61. public function testSetScore()
  62. {
  63. $runner = new atoum\runner();
  64. $this->assert
  65. ->object($runner->setScore($score = new atoum\score()))->isIdenticalTo($runner)
  66. ->object($runner->getScore())->isIdenticalTo($score);
  67. ;
  68. }
  69. public function testSetDefaultReportTtitle()
  70. {
  71. $runner = new atoum\runner();
  72. $this->assert
  73. ->object($runner->setDefaultReportTitle($title = uniqid()))->isIdenticalTo($runner)
  74. ->string($runner->getDefaultReportTitle())->isEqualTo($title)
  75. ;
  76. }
  77. public function testGetPhpPath()
  78. {
  79. $superglobals = new atoum\superglobals();
  80. $runner = new atoum\runner();
  81. $runner->setSuperglobals($superglobals);
  82. $superglobals->_SERVER['_'] = $phpPath = uniqid();
  83. $this->assert
  84. ->string($runner->getPhpPath())->isEqualTo($phpPath)
  85. ;
  86. unset($superglobals->_SERVER['_']);
  87. $runner = new atoum\runner();
  88. $runner->setSuperglobals($superglobals);
  89. $this->assert
  90. ->exception(function() use ($runner) {
  91. $runner->getPhpPath();
  92. }
  93. )
  94. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  95. ;
  96. $runner->setPhpPath($phpPath = uniqid());
  97. $this->assert
  98. ->string($runner->getPhpPath())->isEqualTo($phpPath)
  99. ;
  100. }
  101. public function testSetPhpPath()
  102. {
  103. $runner = new atoum\runner();
  104. $this->assert
  105. ->object($runner->setPhpPath($phpPath = uniqid()))->isIdenticalTo($runner)
  106. ->string($runner->getPhpPath())->isIdenticalTo($phpPath)
  107. ;
  108. $this->assert
  109. ->object($runner->setPhpPath($phpPath = rand(1, PHP_INT_MAX)))->isIdenticalTo($runner)
  110. ->string($runner->getPhpPath())->isIdenticalTo((string) $phpPath)
  111. ;
  112. }
  113. public function testAddObserver()
  114. {
  115. $runner = new atoum\runner();
  116. $this->mockGenerator
  117. ->generate('mageekguy\atoum\observers\runner')
  118. ;
  119. $this->assert
  120. ->array($runner->getObservers())->isEmpty()
  121. ->object($runner->addObserver($observer = new \mock\mageekguy\atoum\observers\runner()))->isIdenticalTo($runner)
  122. ->array($runner->getObservers())->isEqualTo(array($observer))
  123. ;
  124. }
  125. public function testRemoveObserver()
  126. {
  127. $runner = new atoum\runner();
  128. $this->mockGenerator
  129. ->generate('mageekguy\atoum\observers\runner')
  130. ;
  131. $this->assert
  132. ->array($runner->getObservers())->isEmpty()
  133. ->object($runner->removeObserver(new \mock\mageekguy\atoum\observers\runner()))->isIdenticalTo($runner)
  134. ->array($runner->getObservers())->isEmpty()
  135. ;
  136. $runner->addObserver($observer1 = new \mock\mageekguy\atoum\observers\runner());
  137. $runner->addObserver($observer2 = new \mock\mageekguy\atoum\observers\runner());
  138. $this->assert
  139. ->array($runner->getObservers())->isEqualTo(array($observer1, $observer2))
  140. ->object($runner->removeObserver(new \mock\mageekguy\atoum\observers\runner()))->isIdenticalTo($runner)
  141. ->array($runner->getObservers())->isEqualTo(array($observer1, $observer2))
  142. ->object($runner->removeObserver($observer1))->isIdenticalTo($runner)
  143. ->array($runner->getObservers())->isEqualTo(array($observer2))
  144. ->object($runner->removeObserver($observer2))->isIdenticalTo($runner)
  145. ->array($runner->getObservers())->isEmpty()
  146. ;
  147. }
  148. public function testCallObservers()
  149. {
  150. $runner = new atoum\runner();
  151. $this->assert
  152. ->object($runner->callObservers(atoum\runner::runStart))->isIdenticalTo($runner)
  153. ;
  154. $this->mockGenerator
  155. ->generate('mageekguy\atoum\observers\runner')
  156. ;
  157. $runner->addObserver($observer = new \mock\mageekguy\atoum\observers\runner());
  158. $this->assert
  159. ->object($runner->callObservers(atoum\runner::runStart))->isIdenticalTo($runner)
  160. ->mock($observer)->call(atoum\runner::runStart, array($runner))
  161. ;
  162. }
  163. public function testAddTestObserver()
  164. {
  165. $runner = new atoum\runner();
  166. $this->mockGenerator
  167. ->generate('mageekguy\atoum\observers\test')
  168. ;
  169. $this->assert
  170. ->array($runner->getTestObservers())->isEmpty()
  171. ->object($runner->addTestObserver($observer = new \mock\mageekguy\atoum\observers\test()))->isIdenticalTo($runner)
  172. ->array($runner->getTestObservers())->isEqualTo(array($observer))
  173. ;
  174. }
  175. public function testRemoveTestObserver()
  176. {
  177. $runner = new atoum\runner();
  178. $this->mockGenerator
  179. ->generate('mageekguy\atoum\observers\test')
  180. ;
  181. $this->assert
  182. ->array($runner->getTestObservers())->isEmpty()
  183. ->object($runner->removeTestObserver(new \mock\mageekguy\atoum\observers\test()))->isIdenticalTo($runner)
  184. ->array($runner->getTestObservers())->isEmpty()
  185. ;
  186. $runner->addTestObserver($observer1 = new \mock\mageekguy\atoum\observers\test());
  187. $runner->addTestObserver($observer2 = new \mock\mageekguy\atoum\observers\test());
  188. $this->assert
  189. ->array($runner->getTestObservers())->isEqualTo(array($observer1, $observer2))
  190. ->object($runner->removeTestObserver(new \mock\mageekguy\atoum\observers\test()))->isIdenticalTo($runner)
  191. ->array($runner->getTestObservers())->isEqualTo(array($observer1, $observer2))
  192. ->object($runner->removeTestObserver($observer1))->isIdenticalTo($runner)
  193. ->array($runner->getTestObservers())->isEqualTo(array($observer2))
  194. ->object($runner->removeTestObserver($observer2))->isIdenticalTo($runner)
  195. ->array($runner->getTestObservers())->isEmpty()
  196. ;
  197. }
  198. public function testGetRunningDuration()
  199. {
  200. $superglobals = new atoum\superglobals();
  201. $superglobals->_SERVER['_'] = $phpPath = uniqid();
  202. $adapter = new atoum\test\adapter();
  203. $adapter->get_declared_classes = array();
  204. $adapter->proc_open = function() {};
  205. $adapter->stream_get_contents = '';
  206. $adapter->realpath = $phpPath;
  207. $adapter->fclose = function() {};
  208. $adapter->proc_get_status = array('exitcode' => 0, 'running' => true);
  209. $adapter->proc_close = function() {};
  210. $adapter->proc_terminate = function() {};
  211. $adapter->microtime = function() { static $call = 0; return (++$call * 100); };
  212. $adapter->get_declared_classes = function() { return array(); };
  213. $runner = new atoum\runner(null, $adapter, $superglobals);
  214. $this->assert
  215. ->variable($runner->getRunningDuration())->isNull()
  216. ;
  217. $runner->run();
  218. $this->assert
  219. ->integer($runner->getRunningDuration())->isEqualTo(100)
  220. ;
  221. $adapter->defined = true;
  222. }
  223. public function testGetTestNumber()
  224. {
  225. $superglobals = new atoum\superglobals();
  226. $superglobals->_SERVER['_'] = $phpPath = uniqid();
  227. $adapter = new atoum\test\adapter();
  228. $adapter->get_declared_classes = array();
  229. $adapter->proc_open = function() {};
  230. $adapter->stream_get_contents = '';
  231. $adapter->realpath = $phpPath;
  232. $adapter->fclose = function() {};
  233. $adapter->proc_get_status = array('exitcode' => 0, 'running' => true);
  234. $adapter->proc_close = function() {};
  235. $adapter->proc_terminate = function() {};
  236. $runner = new atoum\runner(null, $adapter, $superglobals);
  237. $this->assert
  238. ->variable($runner->getTestNumber())->isNull();
  239. ;
  240. $runner->run();
  241. $this->assert
  242. ->variable($runner->getTestNumber())->isNull();
  243. ;
  244. }
  245. public function testGetTestMethodNumber()
  246. {
  247. $superglobals = new atoum\superglobals();
  248. $superglobals->_SERVER['_'] = $phpPath = uniqid();
  249. $adapter = new atoum\test\adapter();
  250. $adapter->get_declared_classes = array();
  251. $adapter->proc_open = function() {};
  252. $adapter->stream_get_contents = '';
  253. $adapter->realpath = $phpPath;
  254. $adapter->fclose = function() {};
  255. $adapter->proc_get_status = array('exitcode' => 0, 'running' => true);
  256. $adapter->proc_terminate = function() {};
  257. $adapter->proc_close = function() {};
  258. $adapter->get_declared_classes = array();
  259. $runner = new atoum\runner(null, $adapter, $superglobals);
  260. $this->assert
  261. ->variable($runner->getTestMethodNumber())->isNull();
  262. ;
  263. $runner->run();
  264. $this->assert
  265. ->variable($runner->getTestMethodNumber())->isNull();
  266. ;
  267. }
  268. public function testGetObserverEvents()
  269. {
  270. $this->assert
  271. ->array(atoum\runner::getObserverEvents())->isEqualTo(array(atoum\runner::runStart, atoum\runner::runStop))
  272. ;
  273. }
  274. public function testHasReports()
  275. {
  276. $runner = new atoum\runner();
  277. $this->assert
  278. ->boolean($runner->hasReports())->isFalse()
  279. ;
  280. $runner->addReport(new atoum\reports\realtime\cli());
  281. $this->assert
  282. ->boolean($runner->hasReports())->isTrue()
  283. ;
  284. }
  285. public function testAddReport()
  286. {
  287. $runner = new atoum\runner();
  288. $this->assert
  289. ->object($runner->addReport($report = new atoum\reports\realtime\cli()))->isIdenticalTo($runner)
  290. ->array($runner->getReports())->isEqualTo(array($report))
  291. ->array($runner->getObservers())->contains($report)
  292. ->array($runner->getTestObservers())->contains($report)
  293. ;
  294. }
  295. public function testRemoveReport()
  296. {
  297. $runner = new atoum\runner();
  298. $this->assert
  299. ->array($runner->getReports())->isEmpty()
  300. ->array($runner->getObservers())->isEmpty()
  301. ->array($runner->getTestObservers())->isEmpty()
  302. ->object($runner->removeReport(new atoum\reports\realtime\cli()))->isIdenticalTo($runner)
  303. ->array($runner->getReports())->isEmpty()
  304. ->array($runner->getObservers())->isEmpty()
  305. ->array($runner->getTestObservers())->isEmpty()
  306. ;
  307. $this->mockGenerator
  308. ->generate('mageekguy\atoum\report')
  309. ;
  310. $report1 = new \mock\mageekguy\atoum\report();
  311. $report2 = new \mock\mageekguy\atoum\report();
  312. $runner
  313. ->addReport($report1)
  314. ->addReport($report2)
  315. ;
  316. $this->assert
  317. ->array($runner->getReports())->isEqualTo(array($report1, $report2))
  318. ->array($runner->getObservers())->isEqualTo(array($report1, $report2))
  319. ->array($runner->getTestObservers())->isEqualTo(array($report1, $report2))
  320. ->object($runner->removeReport(new atoum\reports\realtime\cli()))->isIdenticalTo($runner)
  321. ->array($runner->getReports())->isEqualTo(array($report1, $report2))
  322. ->array($runner->getObservers())->isEqualTo(array($report1, $report2))
  323. ->array($runner->getTestObservers())->isEqualTo(array($report1, $report2))
  324. ->object($runner->removeReport($report1))->isIdenticalTo($runner)
  325. ->array($runner->getReports())->isEqualTo(array($report2))
  326. ->array($runner->getObservers())->isEqualTo(array($report2))
  327. ->array($runner->getTestObservers())->isEqualTo(array($report2))
  328. ->object($runner->removeReport($report2))->isIdenticalTo($runner)
  329. ->array($runner->getReports())->isEmpty()
  330. ->array($runner->getObservers())->isEmpty()
  331. ->array($runner->getTestObservers())->isEmpty()
  332. ;
  333. }
  334. public function testRemoveReports()
  335. {
  336. $runner = new atoum\runner();
  337. $this->assert
  338. ->array($runner->getReports())->isEmpty()
  339. ->array($runner->getObservers())->isEmpty()
  340. ->array($runner->getTestObservers())->isEmpty()
  341. ->object($runner->removeReports())->isIdenticalTo($runner)
  342. ->array($runner->getReports())->isEmpty()
  343. ->array($runner->getObservers())->isEmpty()
  344. ->array($runner->getTestObservers())->isEmpty()
  345. ;
  346. $this->mockGenerator
  347. ->generate('mageekguy\atoum\report')
  348. ;
  349. $report1 = new \mock\mageekguy\atoum\report();
  350. $report2 = new \mock\mageekguy\atoum\report();
  351. $runner
  352. ->addReport($report1)
  353. ->addReport($report2)
  354. ;
  355. $this->assert
  356. ->array($runner->getReports())->isEqualTo(array($report1, $report2))
  357. ->array($runner->getObservers())->isEqualTo(array($report1, $report2))
  358. ->array($runner->getTestObservers())->isEqualTo(array($report1, $report2))
  359. ->object($runner->removeReports())->isIdenticalTo($runner)
  360. ->array($runner->getReports())->isEmpty()
  361. ->array($runner->getObservers())->isEmpty()
  362. ->array($runner->getTestObservers())->isEmpty()
  363. ;
  364. }
  365. public function testEnableCodeCoverage()
  366. {
  367. $runner = new atoum\runner();
  368. $runner->disableCodeCoverage();
  369. $this->assert
  370. ->boolean($runner->codeCoverageIsEnabled())->isFalse()
  371. ->object($runner->enableCodeCoverage())->isIdenticalTo($runner)
  372. ->boolean($runner->codeCoverageIsEnabled())->isTrue()
  373. ;
  374. }
  375. public function testDisableCodeCoverage()
  376. {
  377. $runner = new atoum\runner();
  378. $runner->enableCodeCoverage();
  379. $this->assert
  380. ->boolean($runner->codeCoverageIsEnabled())->isTrue()
  381. ->object($runner->disableCodeCoverage())->isIdenticalTo($runner)
  382. ->boolean($runner->codeCoverageIsEnabled())->isFalse()
  383. ;
  384. }
  385. public function testSetPathAndVersionInScore()
  386. {
  387. $this->mockGenerator
  388. ->generate('mageekguy\atoum\score')
  389. ;
  390. $score = new \mock\mageekguy\atoum\score();
  391. $scoreController = $score->getMockController();
  392. $adapter = new atoum\test\adapter();
  393. $adapter->defined = false;
  394. $superglobals = new atoum\superglobals();
  395. $runner = new atoum\runner($score, $adapter, $superglobals);
  396. $superglobals->_SERVER['_'] = $phpPath = uniqid();
  397. $adapter->proc_open = false;
  398. $adapter->realpath = function($path) { return $path; };
  399. $this->assert
  400. ->exception(function() use ($runner) {
  401. $runner->setPathAndVersionInScore();
  402. }
  403. )
  404. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  405. ->hasMessage('Unable to open \'' . $phpPath . '\'')
  406. ->adapter($adapter)
  407. ->call('realpath')->withArguments($phpPath)->once()
  408. ->call('defined')->withArguments(atoum\runner::atoumVersionConstant)->once()
  409. ->call('defined')->withArguments(atoum\runner::atoumDirectoryConstant)->once()
  410. ->mock($score)
  411. ->call('setAtoumVersion')->withArguments(null)->once()
  412. ->call('setAtoumPath')->withArguments(null)->once()
  413. ->call('setPhpPath')->never()
  414. ->call('setPhpVersion')->never()
  415. ;
  416. $adapter->realpath = false;
  417. $score->reset();
  418. $scoreController->resetCalls();
  419. $this->assert
  420. ->exception(function() use ($runner) {
  421. $runner->setPathAndVersionInScore();
  422. }
  423. )
  424. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  425. ->hasMessage('Unable to find \'' . $phpPath . '\'')
  426. ->adapter($adapter)
  427. ->call('realpath')->withArguments($phpPath)->once()
  428. ->call('defined')->withArguments(atoum\runner::atoumVersionConstant)->once()
  429. ->call('defined')->withArguments(atoum\runner::atoumDirectoryConstant)->once()
  430. ->mock($score)
  431. ->call('setAtoumVersion')->withArguments(null)->once()
  432. ->call('setAtoumPath')->withArguments(null)->once()
  433. ->call('setPhpPath')->never()
  434. ->call('setPhpVersion')->never()
  435. ;
  436. $adapter->resetCalls();
  437. $adapter->realpath = $phpPath;
  438. $adapter->proc_open = function($cmd, $descriptors, & $pipes) use (& $php, & $stdOut, & $stdErr) {
  439. $pipes = array(
  440. 1 => $stdOut = uniqid(),
  441. 2 => $stErr = uniqid(),
  442. );
  443. return $php = uniqid();
  444. };
  445. $adapter->stream_get_contents = $phpVersion = uniqid();
  446. $adapter->fclose = function() {};
  447. $adapter->proc_close = function() {};
  448. $adapter->proc_terminate = function() {};
  449. $adapter->proc_get_status = array(
  450. 'running' => false,
  451. 'exitcode' => 126
  452. );
  453. $score->reset();
  454. $scoreController->resetCalls();
  455. $this->assert
  456. ->exception(function() use ($runner) {
  457. $runner->setPathAndVersionInScore();
  458. }
  459. )
  460. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  461. ->hasMessage('Unable to execute \'' . $phpPath . '\'')
  462. ->adapter($adapter)
  463. ->call('realpath')->withArguments($phpPath)->once()
  464. ->call('defined')->withArguments(atoum\runner::atoumVersionConstant)->once()
  465. ->call('defined')->withArguments(atoum\runner::atoumDirectoryConstant)->once()
  466. ->call('proc_close')->withArguments($php)->once()
  467. ->mock($score)
  468. ->call('setAtoumVersion')->withArguments(null)->once()
  469. ->call('setAtoumPath')->withArguments(null)->once()
  470. ->call('setPhpPath')->never()
  471. ->call('setPhpVersion')->never()
  472. ;
  473. $adapter->resetCalls();
  474. $adapter->proc_get_status = array(
  475. 'running' => false,
  476. 'exitcode' => 127
  477. );
  478. $score->reset();
  479. $scoreController->reset();
  480. $this->assert
  481. ->exception(function() use ($runner) {
  482. $runner->setPathAndVersionInScore();
  483. }
  484. )
  485. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  486. ->hasMessage('Unable to execute \'' . $phpPath . '\'')
  487. ->adapter($adapter)
  488. ->call('realpath')->withArguments($phpPath)->once()
  489. ->call('defined')->withArguments(atoum\runner::atoumVersionConstant)->once()
  490. ->call('defined')->withArguments(atoum\runner::atoumDirectoryConstant)->once()
  491. ->call('proc_close')->withArguments($php)->once()
  492. ->mock($score)
  493. ->call('setAtoumVersion')->withArguments(null)->once()
  494. ->call('setAtoumPath')->withArguments(null)->once()
  495. ->call('setPhpPath')->never()
  496. ->call('setPhpVersion')->never()
  497. ;
  498. $adapter->resetCalls();
  499. $adapter->proc_get_status = array(
  500. 'exitcode' => 0,
  501. 'running' => true
  502. );
  503. $score->reset();
  504. $scoreController->resetCalls();
  505. $this->assert
  506. ->object($runner->setPathAndVersionInScore())->isIdenticalTo($runner)
  507. ->adapter($adapter)
  508. ->call('realpath')->withArguments($phpPath)->once()
  509. ->call('defined')->withArguments(atoum\runner::atoumVersionConstant)->once()
  510. ->call('defined')->withArguments(atoum\runner::atoumDirectoryConstant)->once()
  511. ->call('stream_get_contents')->withArguments($stdOut)->once()
  512. ->call('fclose')->withArguments($stdOut)->once()
  513. ->call('proc_close')->withArguments($php)->once()
  514. ->mock($score)
  515. ->call('setAtoumVersion')->withArguments(null)->once()
  516. ->call('setAtoumPath')->withArguments(null)->once()
  517. ->call('setPhpPath')->withArguments($phpPath)->once()
  518. ->call('setPhpVersion')->withArguments($phpVersion)->once()
  519. ;
  520. $adapter->defined = true;
  521. $adapter->constant = function($constantName) use (& $atoumVersion, & $atoumDirectory) {
  522. switch ($constantName)
  523. {
  524. case atoum\runner::atoumVersionConstant:
  525. return $atoumVersion = uniqid();
  526. case atoum\runner::atoumDirectoryConstant:
  527. return $atoumDirectory = uniqid();
  528. }
  529. };
  530. $adapter->resetCalls();
  531. $score->reset();
  532. $scoreController->resetCalls();
  533. $this->assert
  534. ->object($runner->setPathAndVersionInScore())->isIdenticalTo($runner)
  535. ->adapter($adapter)
  536. ->call('realpath')->withArguments($phpPath)->once()
  537. ->call('defined')->withArguments(atoum\runner::atoumVersionConstant)->once()
  538. ->call('constant')->withArguments(atoum\runner::atoumVersionConstant)->once()
  539. ->call('defined')->withArguments(atoum\runner::atoumDirectoryConstant)->once()
  540. ->call('constant')->withArguments(atoum\runner::atoumDirectoryConstant)->once()
  541. ->call('stream_get_contents')->withArguments($stdOut)->once()
  542. ->call('fclose')->withArguments($stdOut)->once()
  543. ->call('proc_close')->withArguments($php)->once()
  544. ->mock($score)
  545. ->call('setAtoumVersion')->withArguments($atoumVersion)->once()
  546. ->call('setAtoumPath')->withArguments($atoumDirectory)->once()
  547. ->call('setPhpPath')->withArguments($phpPath)->once()
  548. ->call('setPhpVersion')->withArguments($phpVersion)->once()
  549. ;
  550. }
  551. }
  552. ?>