Skip to content

Commit

Permalink
fix tests for lowest dependency composer
Browse files Browse the repository at this point in the history
  • Loading branch information
venca-x committed Apr 3, 2019
1 parent 4a0d032 commit e8ca776
Show file tree
Hide file tree
Showing 10 changed files with 33 additions and 45 deletions.
7 changes: 5 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ module.exports = function (grunt) {
composer_update: {
command: 'composer update'
},
composer_update_prefer_lowest: {
command: 'composer update --no-progress --prefer-dist --prefer-lowest --prefer-stable'
},
test: {
command: 'vendor\\bin\\tester tests -s -p php'
},
Expand All @@ -22,10 +25,10 @@ module.exports = function (grunt) {
command: 'composer create-project nette/code-checker nette-code-checker'
},
netteCodeChecker: {
command: 'php ..\\..\\nette-code-checker\\src\\code-checker -d src -d tests --short-arrays --strict-types'
command: 'php ..\\..\\nette-code-checker\\code-checker -d src -d tests --short-arrays --strict-types'
},
netteCodeCheckerFIX: {
command: 'php ..\\..\\nette-code-checker\\src\\code-checker -d src -d tests --short-arrays --strict-types --fix'
command: 'php ..\\..\\nette-code-checker\\code-checker -d src -d tests --short-arrays --strict-types --fix'
},
netteCodingStandard: {
command: 'php ..\\..\\nette-coding-standard\\ecs check src tests --config ..\\..\\nette-coding-standard\\coding-standard-php71.yml'
Expand Down
2 changes: 1 addition & 1 deletion src/BaseNetteGMap.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class BaseNetteGMap extends Nette\Application\UI\Control

/**
* Zoom of map (min: 0, max: 16)
* @var int Zoom of map
* @var int Zoom of map
*/
private $zoom;

Expand Down
2 changes: 1 addition & 1 deletion src/layer.latte
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="nettegmap" class="nettegmap-layer" data-map-attr="{$json}">
<div class="nettegmap-canvas"></div>
</div>
</div>
2 changes: 1 addition & 1 deletion src/viewer.latte
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<div id="nettegmap" class="nettegmap-viewer" data-map-attr="{$json}">
<div class="nettegmap-canvas"></div>
</div>
</div>
11 changes: 1 addition & 10 deletions tests/GMapUtilsTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ $container = require __DIR__ . '/bootstrap.php';

class GMapUtilsTest extends Tester\TestCase
{
private $container;


public function __construct(Nette\DI\Container $container)
{
$this->container = $container;
}


public function setUp()
{
}
Expand All @@ -29,5 +20,5 @@ class GMapUtilsTest extends Tester\TestCase
}


$test = new GMapUtilsTest($container);
$test = new GMapUtilsTest();
$test->run();
11 changes: 1 addition & 10 deletions tests/GMapViewerTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ $container = require __DIR__ . '/bootstrap.php';

class GMapViewerTest extends Tester\TestCase
{
private $container;


public function __construct(Nette\DI\Container $container)
{
$this->container = $container;
}


public function setUp()
{
}
Expand All @@ -32,5 +23,5 @@ class GMapViewerTest extends Tester\TestCase
}


$test = new GMapViewerTest($container);
$test = new GMapViewerTest();
$test->run();
11 changes: 1 addition & 10 deletions tests/GpsPointTest.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ require __DIR__ . '/../src/GpsPoint.php';

class GpsPointTest extends Tester\TestCase
{
private $container;


public function __construct(Nette\DI\Container $container)
{
$this->container = $container;
}


public function setUp()
{
}
Expand Down Expand Up @@ -45,5 +36,5 @@ class GpsPointTest extends Tester\TestCase
}
}

$test = new GpsPointTest($container);
$test = new GpsPointTest();
$test->run();
28 changes: 22 additions & 6 deletions tests/bootstrap.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,29 @@
<?php

declare(strict_types=1);
require __DIR__ . '/../vendor/autoload.php';

if (@!include __DIR__ . '/../vendor/autoload.php') {
echo 'Install Nette Tester using `composer install`';
exit(1);
}


Tester\Environment::setup();
date_default_timezone_set('Europe/Prague');


$configurator = new Nette\Configurator;
$configurator->setDebugMode(false);
$configurator->setTempDirectory(__DIR__ . '/temp');
function before(\Closure $function = null)
{
static $val;
if (!func_num_args()) {
return $val ? $val() : null;
}
$val = $function;
}

$configurator->addConfig(__DIR__ . '/config/config.neon');

return $configurator->createContainer();
function test(\Closure $function): void
{
before();
$function();
}
2 changes: 0 additions & 2 deletions tests/config/config.neon

This file was deleted.

2 changes: 0 additions & 2 deletions tests/temp/.gitignore

This file was deleted.

0 comments on commit e8ca776

Please sign in to comment.