/tests/units/classes/scripts/phar/generator.php

https://github.com/Yacodo/atoum · PHP · 709 lines · 567 code · 142 blank · 0 comment · 3 complexity · 82793ab5b1456b9fb4d3241aeaedae83 MD5 · raw file

  1. <?php
  2. namespace mageekguy\atoum\tests\units\scripts\phar;
  3. use
  4. mageekguy\atoum,
  5. mageekguy\atoum\mock,
  6. mageekguy\atoum\scripts\phar
  7. ;
  8. require_once __DIR__ . '/../../../runner.php';
  9. class generator extends atoum\test
  10. {
  11. public function testClassConstants()
  12. {
  13. $this->assert
  14. ->string(phar\generator::phar)->isEqualTo('mageekguy.atoum.phar')
  15. ;
  16. }
  17. public function test__construct()
  18. {
  19. $adapter = new atoum\test\adapter();
  20. $adapter->php_sapi_name = function() { return uniqid(); };
  21. $name = uniqid();
  22. $this->assert
  23. ->exception(function() use ($name, $adapter) {
  24. $generator = new phar\generator($name, null, $adapter);
  25. }
  26. )
  27. ->isInstanceOf('mageekguy\atoum\exceptions\logic')
  28. ->hasMessage('\'' . $name . '\' must be used in CLI only')
  29. ;
  30. $adapter->php_sapi_name = function() { return 'cli'; };
  31. $name = uniqid();
  32. $generator = new phar\generator($name, null, $adapter);
  33. $this->assert
  34. ->object($generator->getLocale())->isInstanceOf('mageekguy\atoum\locale')
  35. ->object($generator->getAdapter())->isInstanceOf('mageekguy\atoum\adapter')
  36. ->object($generator->getOutputWriter())->isInstanceOf('mageekguy\atoum\writer')
  37. ->object($generator->getErrorWriter())->isInstanceOf('mageekguy\atoum\writer')
  38. ->string($generator->getName())->isEqualTo($name)
  39. ->variable($generator->getOriginDirectory())->isNull()
  40. ->variable($generator->getDestinationDirectory())->isNull()
  41. ->object($generator->getArgumentsParser())->isInstanceOf('mageekguy\atoum\script\arguments\parser')
  42. ;
  43. $name = uniqid();
  44. $locale = new atoum\locale();
  45. $generator = new phar\generator($name, $locale, $adapter);
  46. $this->assert
  47. ->object($generator->getLocale())->isIdenticalTo($locale)
  48. ->object($generator->getAdapter())->isIdenticalTo($adapter)
  49. ->string($generator->getName())->isEqualTo($name)
  50. ->variable($generator->getOriginDirectory())->isNull()
  51. ->variable($generator->getDestinationDirectory())->isNull()
  52. ->object($generator->getArgumentsParser())->isInstanceOf('mageekguy\atoum\script\arguments\parser')
  53. ;
  54. }
  55. public function testSetOriginDirectory()
  56. {
  57. $adapter = new atoum\test\adapter();
  58. $adapter->php_sapi_name = function() { return 'cli'; };
  59. $adapter->realpath = function($path) { return $path; };
  60. $generator = new phar\generator(uniqid(), null, $adapter);
  61. $this->assert
  62. ->exception(function() use ($generator) {
  63. $generator->setOriginDirectory('');
  64. }
  65. )
  66. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  67. ->hasMessage('Empty origin directory is invalid')
  68. ;
  69. $adapter->is_dir = function() { return false; };
  70. $directory = uniqid();
  71. $this->assert
  72. ->exception(function() use ($generator, $directory) {
  73. $generator->setOriginDirectory($directory);
  74. }
  75. )
  76. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  77. ->hasMessage('Path \'' . $directory . '\' of origin directory is invalid')
  78. ;
  79. $adapter->is_dir = function() { return true; };
  80. $this->assert
  81. ->object($generator->setOriginDirectory('/'))->isIdenticalTo($generator)
  82. ->string($generator->getOriginDirectory())->isEqualTo('/')
  83. ;
  84. $directory = uniqid();
  85. $this->assert
  86. ->object($generator->setOriginDirectory($directory . '/'))->isIdenticalTo($generator)
  87. ->string($generator->getOriginDirectory())->isEqualTo($directory)
  88. ;
  89. $generator->setDestinationDirectory(uniqid());
  90. $this->assert
  91. ->exception(function() use ($generator) {
  92. $generator->setOriginDirectory($generator->getDestinationDirectory());
  93. }
  94. )
  95. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  96. ->hasMessage('Origin directory must be different from destination directory')
  97. ;
  98. $realDirectory = $generator->getDestinationDirectory() . DIRECTORY_SEPARATOR . uniqid();
  99. $adapter->realpath = function($path) use ($realDirectory) { return $realDirectory; };
  100. $this->assert
  101. ->object($generator->setOriginDirectory('/'))->isIdenticalTo($generator)
  102. ->string($generator->getOriginDirectory())->isEqualTo($realDirectory)
  103. ;
  104. }
  105. public function testSetDestinationDirectory()
  106. {
  107. $adapter = new atoum\test\adapter();
  108. $adapter->php_sapi_name = function() { return 'cli'; };
  109. $adapter->realpath = function($path) { return $path; };
  110. $generator = new phar\generator(uniqid(), null, $adapter);
  111. $this->assert
  112. ->exception(function() use ($generator) {
  113. $generator->setDestinationDirectory('');
  114. }
  115. )
  116. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  117. ->hasMessage('Empty destination directory is invalid')
  118. ;
  119. $adapter->is_dir = function() { return false; };
  120. $directory = uniqid();
  121. $this->assert
  122. ->exception(function() use ($generator, $directory) {
  123. $generator->setDestinationDirectory($directory);
  124. }
  125. )
  126. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  127. ->hasMessage('Path \'' . $directory . '\' of destination directory is invalid')
  128. ;
  129. $adapter->is_dir = function() { return true; };
  130. $this->assert
  131. ->object($generator->setDestinationDirectory('/'))->isIdenticalTo($generator)
  132. ->string($generator->getDestinationDirectory())->isEqualTo('/')
  133. ;
  134. $directory = uniqid();
  135. $this->assert
  136. ->object($generator->setDestinationDirectory($directory))->isIdenticalTo($generator)
  137. ->string($generator->getDestinationDirectory())->isEqualTo($directory)
  138. ;
  139. $directory = uniqid();
  140. $this->assert
  141. ->object($generator->setDestinationDirectory($directory . '/'))->isIdenticalTo($generator)
  142. ->string($generator->getDestinationDirectory())->isEqualTo($directory)
  143. ;
  144. $generator->setOriginDirectory(uniqid());
  145. $this->assert
  146. ->exception(function() use ($generator) {
  147. $generator->setDestinationDirectory($generator->getOriginDirectory());
  148. }
  149. )
  150. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  151. ->hasMessage('Destination directory must be different from origin directory')
  152. ;
  153. $realDirectory = $generator->getOriginDirectory() . DIRECTORY_SEPARATOR . uniqid();
  154. $adapter->realpath = function($path) use ($realDirectory) { return $realDirectory; };
  155. $this->assert
  156. ->exception(function() use ($generator) {
  157. $generator->setDestinationDirectory(uniqid());
  158. }
  159. )
  160. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  161. ->hasMessage('Origin directory must not include destination directory')
  162. ;
  163. }
  164. public function testSetStubFile()
  165. {
  166. $adapter = new atoum\test\adapter();
  167. $adapter->php_sapi_name = function() { return 'cli'; };
  168. $adapter->realpath = function($path) { return $path; };
  169. $generator = new phar\generator(uniqid(), null, $adapter);
  170. $this->assert
  171. ->exception(function() use ($generator) {
  172. $generator->setStubFile('');
  173. }
  174. )
  175. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  176. ->hasMessage('Stub file is invalid')
  177. ;
  178. $adapter->is_file = function() { return false; };
  179. $this->assert
  180. ->exception(function() use ($generator) {
  181. $generator->setStubFile(uniqid());
  182. }
  183. )
  184. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  185. ->hasMessage('Stub file is not a valid file')
  186. ;
  187. $adapter->is_file = function() { return true; };
  188. $this->assert
  189. ->object($generator->setStubFile($stubFile = uniqid()))->isIdenticalTo($generator)
  190. ->string($generator->getStubFile())->isEqualTo($stubFile)
  191. ;
  192. }
  193. public function testSetPharInjector()
  194. {
  195. $adapter = new atoum\test\adapter();
  196. $adapter->php_sapi_name = function() { return 'cli'; };
  197. $adapter->realpath = function($path) { return $path; };
  198. $adapter->is_dir = function() { return true; };
  199. $generator = new phar\generator(uniqid(), null, $adapter);
  200. $this->assert
  201. ->exception(function() use ($generator) {
  202. $generator->setPharInjector(function() {});
  203. }
  204. )
  205. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  206. ->hasMessage('Phar injector must take one argument')
  207. ;
  208. $mockController = new mock\controller();
  209. $mockController
  210. ->injectInNextMockInstance()
  211. ->__construct = function() {}
  212. ;
  213. $this->mockGenerator
  214. ->generate('phar')
  215. ;
  216. $pharName = uniqid();
  217. $phar = new \mock\phar($pharName);
  218. $this->assert
  219. ->exception(function() use ($generator, $pharName) { $generator->getPhar($pharName); })
  220. ->isInstanceOf('unexpectedValueException')
  221. ->object($generator->setPharInjector(function($name) use ($phar) { return $phar; }))->isIdenticalTo($generator)
  222. ->object($generator->getPhar(uniqid()))->isIdenticalTo($phar)
  223. ;
  224. }
  225. public function testSetFileIteratorInjector()
  226. {
  227. $adapter = new atoum\test\adapter();
  228. $adapter->php_sapi_name = function() { return 'cli'; };
  229. $adapter->realpath = function($path) { return $path; };
  230. $adapter->is_dir = function() { return true; };
  231. $generator = new phar\generator(uniqid(), null, $adapter);
  232. $this->assert
  233. ->exception(function() use ($generator) {
  234. $generator->setSrcIteratorInjector(function() {});
  235. }
  236. )
  237. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  238. ->hasMessage('Source iterator injector must take one argument')
  239. ;
  240. $directory = uniqid();
  241. $mockController = new mock\controller();
  242. $mockController
  243. ->injectInNextMockInstance()
  244. ->__construct = function() {}
  245. ;
  246. $this->mockGenerator
  247. ->generate('recursiveDirectoryIterator')
  248. ;
  249. $iterator = new \mock\recursiveDirectoryIterator($directory);
  250. $this->assert
  251. ->exception(function() use ($generator, $directory) { $generator->getSrcIterator($directory); })
  252. ->isInstanceOf('unexpectedValueException')
  253. ->hasMessage('RecursiveDirectoryIterator::__construct(' . $directory . '): failed to open dir: No such file or directory')
  254. ->object($generator->setSrcIteratorInjector(function($directory) use ($iterator) { return $iterator; }))->isIdenticalTo($generator)
  255. ->object($generator->getSrcIterator(uniqid()))->isIdenticalTo($iterator)
  256. ;
  257. }
  258. public function testSetOutputWriter()
  259. {
  260. $generator = new phar\generator(uniqid());
  261. $stdout = new atoum\writers\std\out();
  262. $this->assert
  263. ->object($generator->setOutputWriter($stdout))->isIdenticalTo($generator)
  264. ->object($generator->getOutputWriter())->isIdenticalTo($stdout)
  265. ;
  266. }
  267. public function testSetErrorWriter()
  268. {
  269. $generator = new phar\generator(uniqid());
  270. $stderr = new atoum\writers\std\err();
  271. $this->assert
  272. ->object($generator->setErrorWriter($stderr))->isIdenticalTo($generator)
  273. ->object($generator->getErrorWriter())->isIdenticalTo($stderr)
  274. ;
  275. }
  276. public function testWriteMessage()
  277. {
  278. $generator = new phar\generator(uniqid());
  279. $this->mockGenerator
  280. ->generate('mageekguy\atoum\writers\std\out')
  281. ;
  282. $stdout = new \mock\mageekguy\atoum\writers\std\out();
  283. $stdout->getMockController()->write = function() {};
  284. $generator->setOutputWriter($stdout);
  285. $this->assert
  286. ->object($generator->writeMessage($message = uniqid()))->isIdenticalTo($generator)
  287. ->mock($stdout)
  288. ->call('write')->withArguments($message . PHP_EOL)->once()
  289. ;
  290. }
  291. public function testWriteError()
  292. {
  293. $generator = new phar\generator(uniqid());
  294. $this->mockGenerator
  295. ->generate('mageekguy\atoum\writers\std\err')
  296. ;
  297. $stderr = new \mock\mageekguy\atoum\writers\std\err();
  298. $stderr->getMockController()->write = function() {};
  299. $generator->setErrorWriter($stderr);
  300. $this->assert
  301. ->object($generator->writeError($error = uniqid()))->isIdenticalTo($generator)
  302. ->mock($stderr)
  303. ->call('write')->withArguments(sprintf($generator->getLocale()->_('Error: %s'), $error) . PHP_EOL)->once()
  304. ;
  305. }
  306. public function testRun()
  307. {
  308. $adapter = new atoum\test\adapter();
  309. $adapter->php_sapi_name = function() { return 'cli'; };
  310. $adapter->realpath = function($path) { return $path; };
  311. $adapter->is_dir = function() { return true; };
  312. $adapter->is_file = function() { return true; };
  313. $adapter->unlink = function() {};
  314. $generator = new phar\generator(uniqid(), null, $adapter);
  315. $this->assert
  316. ->exception(function () use ($generator) {
  317. $generator->run();
  318. }
  319. )
  320. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  321. ->hasMessage('Origin directory must be defined')
  322. ;
  323. $generator->setOriginDirectory($originDirectory = uniqid());
  324. $this->assert
  325. ->exception(function () use ($generator) {
  326. $generator->run();
  327. }
  328. )
  329. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  330. ->hasMessage('Destination directory must be defined')
  331. ;
  332. $generator->setDestinationDirectory(uniqid());
  333. $this->assert
  334. ->exception(function () use ($generator) {
  335. $generator->run();
  336. }
  337. )
  338. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  339. ->hasMessage('Stub file must be defined')
  340. ;
  341. $generator->setStubFile($stubFile = uniqid());
  342. $adapter->is_readable = function() { return false; };
  343. $this->assert
  344. ->exception(function () use ($generator) {
  345. $generator->run();
  346. }
  347. )
  348. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  349. ->hasMessage('Origin directory \'' . $generator->getOriginDirectory() . '\' is not readable')
  350. ;
  351. $adapter->is_readable = function($path) use ($originDirectory) { return ($path === $originDirectory); };
  352. $adapter->is_writable = function() { return false; };
  353. $this->assert
  354. ->exception(function () use ($generator) {
  355. $generator->run();
  356. }
  357. )
  358. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  359. ->hasMessage('Destination directory \'' . $generator->getDestinationDirectory() . '\' is not writable')
  360. ;
  361. $adapter->is_writable = function() { return true; };
  362. $this->assert
  363. ->exception(function () use ($generator) {
  364. $generator->run();
  365. }
  366. )
  367. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  368. ->hasMessage('Stub file \'' . $generator->getStubFile() . '\' is not readable')
  369. ;
  370. $adapter->is_readable = function($path) use ($originDirectory, $stubFile) { return ($path === $originDirectory || $path === $stubFile); };
  371. $generator->setPharInjector(function($name) { return null; });
  372. $this->assert
  373. ->exception(function() use ($generator) {
  374. $generator->run();
  375. }
  376. )
  377. ->isInstanceOf('mageekguy\atoum\exceptions\logic')
  378. ->hasMessage('Phar injector must return a \phar instance')
  379. ;
  380. $this->mockGenerator
  381. ->generate('phar')
  382. ;
  383. $generator->setPharInjector(function($name) use (& $phar) {
  384. $pharController = new mock\controller();
  385. $pharController->__construct = function() {};
  386. $pharController->setStub = function() {};
  387. $pharController->setMetadata = function() {};
  388. $pharController->buildFromIterator = function() {};
  389. $pharController->setSignatureAlgorithm = function() {};
  390. $pharController->offsetGet = function() {};
  391. $pharController->injectInNextMockInstance();
  392. return ($phar = new \mock\phar($name));
  393. }
  394. );
  395. $generator->setSrcIteratorInjector(function($directory) { return null; });
  396. $this->assert
  397. ->exception(function() use ($generator) {
  398. $generator->run();
  399. }
  400. )
  401. ->isInstanceOf('mageekguy\atoum\exceptions\logic')
  402. ->hasMessage('Source iterator injector must return a \recursiveDirectoryIterator instance')
  403. ;
  404. $this->mockGenerator
  405. ->generate('recursiveDirectoryIterator')
  406. ;
  407. $generator->setSrcIteratorInjector(function($directory) use (& $srcIterator) {
  408. $srcIteratorController = new mock\controller();
  409. $srcIteratorController->injectInNextMockInstance();
  410. $srcIteratorController->__construct = function() {};
  411. $srcIteratorController->injectInNextMockInstance();
  412. return ($srcIterator = new \mock\recursiveDirectoryIterator($directory));
  413. }
  414. );
  415. $generator->setConfigurationsIteratorInjector(function($directory) use (& $configurationsIterator) {
  416. $configurationsIteratorController = new mock\controller();
  417. $configurationsIteratorController->injectInNextMockInstance();
  418. $configurationsIteratorController->__construct = function() {};
  419. $configurationsIteratorController->injectInNextMockInstance();
  420. return ($configurationsIterator = new \mock\recursiveDirectoryIterator($directory));
  421. }
  422. );
  423. $adapter->file_get_contents = function($file) { return false; };
  424. $this->assert
  425. ->exception(function() use ($generator) {
  426. $generator->run();
  427. }
  428. )
  429. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  430. ->hasMessage('ABOUT file is missing in \'' . $generator->getOriginDirectory() . '\'')
  431. ;
  432. $description = uniqid();
  433. $adapter->file_get_contents = function($file) use ($generator, $description) {
  434. switch ($file)
  435. {
  436. case $generator->getOriginDirectory() . DIRECTORY_SEPARATOR . 'ABOUT':
  437. return $description;
  438. default:
  439. return false;
  440. }
  441. };
  442. $this->assert
  443. ->exception(function() use ($generator) {
  444. $generator->run();
  445. }
  446. )
  447. ->isInstanceOf('mageekguy\atoum\exceptions\runtime')
  448. ->hasMessage('COPYING file is missing in \'' . $generator->getOriginDirectory() . '\'')
  449. ;
  450. $licence = uniqid();
  451. $stub = uniqid();
  452. $adapter->file_get_contents = function($file) use ($generator, $description, $licence, $stub) {
  453. switch ($file)
  454. {
  455. case $generator->getOriginDirectory() . DIRECTORY_SEPARATOR . 'ABOUT':
  456. return $description;
  457. case $generator->getOriginDirectory() . DIRECTORY_SEPARATOR . 'COPYING':
  458. return $licence;
  459. case $generator->getStubFile():
  460. return $stub;
  461. default:
  462. return uniqid();
  463. }
  464. };
  465. $this->assert
  466. ->object($generator->run())->isIdenticalTo($generator)
  467. ->mock($phar)
  468. ->call('__construct')->withArguments($generator->getDestinationDirectory() . DIRECTORY_SEPARATOR . atoum\scripts\phar\generator::phar, null, null, null)->once()
  469. ->call('setMetadata')
  470. ->withArguments(array(
  471. 'version' => atoum\version,
  472. 'author' => atoum\author,
  473. 'support' => atoum\mail,
  474. 'repository' => atoum\repository,
  475. 'description' => $description,
  476. 'licence' => $licence
  477. )
  478. )
  479. ->once()
  480. ->call('setStub')->withArguments($stub, null)->once()
  481. ->call('buildFromIterator')
  482. ->withArguments(new \recursiveIteratorIterator(new atoum\src\iterator\filter($srcIterator)), $generator->getOriginDirectory())
  483. ->once()
  484. ->call('setSignatureAlgorithm')
  485. ->withArguments(\phar::SHA1, null)
  486. ->once()
  487. ->mock($srcIterator)
  488. ->call('__construct')->withArguments($generator->getOriginDirectory(), null)->once()
  489. ;
  490. $superglobals = new atoum\superglobals();
  491. $superglobals->_SERVER = array('argv' => array(uniqid(), '--help'));
  492. $generator->setArgumentsParser(new atoum\script\arguments\parser($superglobals));
  493. $this->mockGenerator
  494. ->generate('mageekguy\atoum\writers\std\out')
  495. ->generate('mageekguy\atoum\writers\std\err')
  496. ;
  497. $stdout = new \mock\mageekguy\atoum\writers\std\out();
  498. $stdout
  499. ->getMockController()
  500. ->write = function() {}
  501. ;
  502. $stderr = new \mock\mageekguy\atoum\writers\std\err();
  503. $stderr
  504. ->getMockController()
  505. ->write = function() {}
  506. ;
  507. $generator
  508. ->setOutputWriter($stdout)
  509. ->setErrorWriter($stderr)
  510. ;
  511. $this->assert
  512. ->object($generator->run())->isIdenticalTo($generator)
  513. ->mock($stdout)
  514. ->call('write')->withArguments(sprintf($generator->getLocale()->_('Usage: %s [options]'), $generator->getName()) . PHP_EOL)->once()
  515. ->call('write')->withArguments($generator->getLocale()->_('Available options are:') . PHP_EOL)->once()
  516. ->call('write')->withArguments(' -h, --help: ' . $generator->getLocale()->_('Display this help') . PHP_EOL)->once()
  517. ->call('write')->withArguments(' -d <directory>, --directory <directory>: ' . $generator->getLocale()->_('Destination directory <dir>') . PHP_EOL)->once()
  518. ;
  519. $generator->setPharInjector(function($name) use (& $phar) {
  520. $pharController = new mock\controller();
  521. $pharController->injectInNextMockInstance();
  522. $pharController->__construct = function() {};
  523. $pharController->setStub = function() {};
  524. $pharController->setMetadata = function() {};
  525. $pharController->buildFromIterator = function() {};
  526. $pharController->setSignatureAlgorithm = function() {};
  527. $pharController->offsetGet = function() {};
  528. $pharController->injectInNextMockInstance();
  529. return ($phar = new \mock\phar($name));
  530. }
  531. );
  532. $this->assert
  533. ->object($generator->run(array('-d', $directory = uniqid())))->isIdenticalTo($generator)
  534. ->string($generator->getDestinationDirectory())->isEqualTo($directory)
  535. ->mock($phar)
  536. ->call('__construct')
  537. ->withArguments($generator->getDestinationDirectory() . DIRECTORY_SEPARATOR . atoum\scripts\phar\generator::phar, null, null, null)
  538. ->once()
  539. ->call('setMetadata')
  540. ->withArguments(
  541. array(
  542. 'version' => atoum\version,
  543. 'author' => atoum\author,
  544. 'support' => atoum\mail,
  545. 'repository' => atoum\repository,
  546. 'description' => $description,
  547. 'licence' => $licence
  548. )
  549. )
  550. ->once()
  551. ->call('setStub')->withArguments($stub, null)->once()
  552. ->call('buildFromIterator')
  553. ->withArguments(new \recursiveIteratorIterator(new atoum\src\iterator\filter($srcIterator)), $generator->getOriginDirectory())
  554. ->once()
  555. ->call('setSignatureAlgorithm')
  556. ->withArguments(\phar::SHA1, null)
  557. ->once()
  558. ->mock($srcIterator)
  559. ->call('__construct')
  560. ->withArguments($generator->getOriginDirectory(), null)
  561. ->once()
  562. ->adapter($adapter)
  563. ->call('unlink')->withArguments($directory . DIRECTORY_SEPARATOR . phar\generator::phar)->once()
  564. ;
  565. }
  566. }
  567. ?>