Skip to content

Commit

Permalink
完善
Browse files Browse the repository at this point in the history
  • Loading branch information
yunwuxin committed Jul 29, 2016
1 parent d6178eb commit 09a0d02
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/ThinkTesting.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,21 @@ public function getInstallPath(PackageInterface $package)
public function install(InstalledRepositoryInterface $repo, PackageInterface $package)
{
parent::install($repo, $package);

//copy tests dir
$appDir = dirname($this->vendorDir);
if (!is_file($appDir . DIRECTORY_SEPARATOR . 'phpunit.xml')) {

$it = new RecursiveDirectoryIterator($this->getInstallPath($package), RecursiveDirectoryIterator::SKIP_DOTS);
$ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::SELF_FIRST);
$it = new RecursiveDirectoryIterator($this->getInstallPath($package), RecursiveDirectoryIterator::SKIP_DOTS);
$ri = new RecursiveIteratorIterator($it, RecursiveIteratorIterator::SELF_FIRST);

foreach ($ri as $file) {
$targetPath = $appDir . DIRECTORY_SEPARATOR . $ri->getSubPathName();
if ($file->isDir()) {
$this->filesystem->ensureDirectoryExists($targetPath);
} else {
copy($file->getPathname(), $targetPath);
foreach ($ri as $file) {
$targetPath = $appDir . DIRECTORY_SEPARATOR . $ri->getSubPathName();
if ($file->isDir()) {
$this->filesystem->ensureDirectoryExists($targetPath);
} else {
copy($file->getPathname(), $targetPath);
}
}
}
}
Expand Down

0 comments on commit 09a0d02

Please sign in to comment.