Skip to content

Commit

Permalink
tests: remove touch, typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Matějček committed Jul 7, 2017
1 parent 366f175 commit 8aba728
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Expand Up @@ -6,7 +6,7 @@ php:

before_script:
- composer self-update
- if [ "$TRAVIS_PHP_VERSION" == "7.1" ]; then NTESTER_FLAGS="phpdbg --coverage ./coverage.xml --coverage-src ./src"; else TESTER_FLAGS=""; fi
- if [ "$TRAVIS_PHP_VERSION" == "7.1" ]; then NTESTER_FLAGS="phpdbg --coverage ./coverage.xml --coverage-src ./src"; else NTESTER_FLAGS=""; fi

after_script:
- if [ "$TRAVIS_PHP_VERSION" == "7.1" ]; then
Expand Down
3 changes: 1 addition & 2 deletions tests/src/AssetsTest.phpt
Expand Up @@ -6,8 +6,7 @@ use Tester\Assert;

$container = require __DIR__ . '/../bootsrap.php';

$time = 1490036475;
touch(__DIR__ . '/../config/php-unix.ini', $time);
$time = filemtime(__DIR__ . '/../config/php-unix.ini');

test(function() use ($container, $time) {
/* @var $assets Assets */
Expand Down
5 changes: 2 additions & 3 deletions tests/src/BasicRunTest.phpt
Expand Up @@ -5,8 +5,7 @@ use h4kuna\Assets,

$container = require __DIR__ . '/../bootsrap.php';

$time = 1490036475; // mtime jsquery
touch(__DIR__ . '/../config/php-unix.ini', $time);
$time = filemtime(__DIR__ . '/../config/php-unix.ini');

/* @var $file Assets\File */
$file = $container->getByType(Assets\File::class);
Expand All @@ -17,4 +16,4 @@ Assert::same('/config/php-unix.ini?' . $time, $file->createUrl('config/php-unix.

Assert::same('//www.example.com/config/test.neon', preg_replace('~\?.*~', '', $file->createUrl('//config/test.neon')));

Assert::same('/temp/jquery-3.2.1.min.js?' . $time, $file->createUrl('temp/jquery-3.2.1.min.js'));
Assert::same('/temp/jquery-3.2.1.min.js?1490036475', $file->createUrl('temp/jquery-3.2.1.min.js'));
13 changes: 7 additions & 6 deletions tests/src/DI/AssetsExtensionTest.phpt
Expand Up @@ -55,27 +55,28 @@ Assert::exception(function() {
configuratorFactory('file-not-found.neon');
}, Assets\FileNotFoundException::class);


Assert::exception(function() {
configuratorFactory('fs-main.neon', TRUE);
}, Assets\DirectoryIsNotWriteableException::class);

$x = function() {

test(function() {
touch(__DIR__ . '/assets/main.js', 123456789);
$container = configuratorFactory('fs-main.neon');
$file = $container->getByType(Assets\File::class);
/* @var $file \h4kuna\Assets\File */
Assert::same('/temp/main.js?123456789', $file->createUrl('temp/main.js'));
};
$x();
});


$x = function() {
test(function() {
touch(__DIR__ . '/assets/main.js', 123456789);
$container = configuratorFactory('fs-main-alias.neon');
$file = $container->getByType(Assets\File::class);
/* @var $file \h4kuna\Assets\File */
Assert::same('/temp/app/index.js?123456789', $file->createUrl('temp/app/index.js'));
};
$x();
});


Assert::exception(function() {
Expand Down

0 comments on commit 8aba728

Please sign in to comment.