Skip to content

Commit

Permalink
Merge pull request #16 from koriym/stage
Browse files Browse the repository at this point in the history
"stage" context does not clear tmp folder
  • Loading branch information
koriym authored Jul 24, 2017
2 parents f478c30 + 02d33b4 commit f4f2df9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ nbproject
cache.properties
build
vendor/
composer.phar

composer.lock
.php_cs.cache
4 changes: 2 additions & 2 deletions src/AppMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ public function __construct($name, $context = 'app', $appDir = null)
if (! file_exists($this->logDir) && mkdir($this->logDir) && ! is_writable($this->logDir)) {
throw new NotWritableException($this->logDir);
}
$isDevelop = strpos($context, 'prod') === false;
if ($isDevelop) {
$isCacheable = is_int(strpos($context, 'prod-')) || is_int(strpos($context, 'stage-'));
if (! $isCacheable) {
$this->clearTmpDirectory($this->tmpDir);
}
}
Expand Down
5 changes: 2 additions & 3 deletions tests/AppMetaTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*/
namespace BEAR\AppMeta;

use BEAR\AppMeta\Exception\AppNameException;
use PHPUnit\Framework\TestCase;

class AppMetaTest extends TestCase
Expand Down Expand Up @@ -56,11 +57,9 @@ public function testAppReflectorResourceList()
$this->assertSame($expect, $files);
}

/**
* @expectedException \BEAR\AppMeta\Exception\AppNameException
*/
public function testInvalidName()
{
$this->expectException(AppNameException::class);
new AppMeta('Invalid\Invalid');
}

Expand Down

0 comments on commit f4f2df9

Please sign in to comment.