Skip to content

Commit 5c6619d

Browse files
committed
Revert last hackish test refactoring and use test name in test path instead
1 parent 1d1909c commit 5c6619d

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

tests/MagentoHackathon/Composer/Magento/Deploystrategy/AbstractTest.php

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ abstract function getTestDeployStrategyFiletype($isDir = false);
4949
protected function setUp()
5050
{
5151
$this->filesystem = new \Composer\Util\Filesystem();
52-
$this->sourceDir = sys_get_temp_dir() . DS . "module_dir";
53-
$this->destDir = sys_get_temp_dir() . DS . "magento_dir";
52+
$this->sourceDir = sys_get_temp_dir() . DS . $this->getName() . DS . "module_dir";
53+
$this->destDir = sys_get_temp_dir() . DS . $this->getName() . DS . "magento_dir";
5454
$this->filesystem->ensureDirectoryExists($this->sourceDir);
5555
$this->filesystem->ensureDirectoryExists($this->destDir);
5656

@@ -70,6 +70,8 @@ protected function tearDown()
7070
/**
7171
* @param string $file
7272
* @param string $type
73+
* @throws \InvalidArgumentException
74+
* @throws \PHPUnit_Framework_AssertionFailedError
7375
*/
7476
public function assertFileType($file, $type)
7577
{
@@ -139,7 +141,7 @@ public function testAddMapping()
139141

140142
public function testCreate()
141143
{
142-
$src = 'local.xml';
144+
$src = 'local1.xml';
143145
$dest = 'local2.xml';
144146
touch($this->sourceDir . DS . $src);
145147
$this->assertTrue(is_readable($this->sourceDir . DS . $src));
@@ -150,7 +152,7 @@ public function testCreate()
150152

151153
public function testCopyDirToDir()
152154
{
153-
$src = "hello";
155+
$src = "hello1";
154156
$dest = "hello2";
155157
$this->mkdir($this->sourceDir . DS . $src);
156158
touch($this->sourceDir . DS . $src . DS . "local.xml");
@@ -235,7 +237,7 @@ public function testGlobTargetDirDoesNotExists()
235237

236238
public function testGlobSlashDirectoryExists()
237239
{
238-
$globSource = "sourcedir/test1.xml";
240+
$globSource = "sourcedir/test.xml";
239241
$this->mkdir($this->sourceDir . DS . dirname($globSource));
240242
touch($this->sourceDir . DS . $globSource);
241243

@@ -254,7 +256,7 @@ public function testGlobSlashDirectoryExists()
254256

255257
public function testGlobSlashDirectoryDoesNotExists()
256258
{
257-
$globSource = "sourcedir/test2.xml";
259+
$globSource = "sourcedir/test.xml";
258260
$this->mkdir($this->sourceDir . DS . dirname($globSource));
259261
touch($this->sourceDir . DS . $globSource);
260262

@@ -274,7 +276,7 @@ public function testGlobWildcardTargetDirDoesNotExist()
274276
{
275277
$globSource = "sourcedir/*";
276278
$glob_dir = dirname($globSource);
277-
$files = array('test3.xml', 'test4.xml');
279+
$files = array('test1.xml', 'test2.xml');
278280
$this->mkdir($this->sourceDir . DS . $glob_dir);
279281
foreach ($files as $file) {
280282
touch($this->sourceDir . DS . $glob_dir . DS . $file);
@@ -301,7 +303,7 @@ public function testGlobWildcardTargetDirDoesExist()
301303
{
302304
$globSource = "sourcedir/*";
303305
$glob_dir = dirname($globSource);
304-
$files = array('test5.xml', 'test6.xml');
306+
$files = array('test1.xml', 'test2.xml');
305307
$this->mkdir($this->sourceDir . DS . $glob_dir);
306308
foreach ($files as $file) {
307309
touch($this->sourceDir . DS . $glob_dir . DS . $file);
@@ -337,7 +339,7 @@ public function testSourceAndTargetAreDirsDoNotExist()
337339
$this->setUp();
338340

339341
list ($globSource, $dest) = $fixture;
340-
$sourceDirContent = "test7.xml";
342+
$sourceDirContent = "test.xml";
341343
$this->mkdir($this->sourceDir . DS . $globSource);
342344
touch($this->sourceDir . DS . $globSource . DS . $sourceDirContent);
343345

@@ -369,7 +371,7 @@ public function testSourceAndTargetAreDirsDoExist()
369371
$this->setUp();
370372

371373
list ($globSource, $dest) = $fixture;
372-
$sourceDirContent = "test8.xml";
374+
$sourceDirContent = "test.xml";
373375
$this->mkdir($this->sourceDir . DS . $globSource);
374376
touch($this->sourceDir . DS . $globSource . DS . $sourceDirContent);
375377

tests/MagentoHackathon/Composer/Magento/Deploystrategy/SymlinkTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function getTestDeployStrategyFiletype($isDir = false)
2424

2525
public function testClean()
2626
{
27-
$src = 'local.xml';
27+
$src = 'local1.xml';
2828
$dest = 'local2.xml';
2929
touch($this->sourceDir . DIRECTORY_SEPARATOR . $src);
3030
$this->assertTrue(is_readable($this->sourceDir . DIRECTORY_SEPARATOR . $src));

0 commit comments

Comments
 (0)