Skip to content

Commit

Permalink
fix tests, update packages
Browse files Browse the repository at this point in the history
  • Loading branch information
Gappa committed Sep 4, 2018
1 parent 7b2ca94 commit 6269bd6
Show file tree
Hide file tree
Showing 15 changed files with 26 additions and 33 deletions.
10 changes: 1 addition & 9 deletions WebLoader/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -321,12 +321,8 @@ public function setOutputNamingConvention(IOutputNamingConvention $namingConvent
}


public function addFilter($filter): void
public function addFilter(callable $filter): void
{
if (!is_callable($filter)) {
throw new \WebLoader\InvalidArgumentException('Filter is not callable.');
}

$this->filters[] = $filter;
}

Expand All @@ -339,10 +335,6 @@ public function getFilters(): array

public function addFileFilter(callable $filter): void
{
if (!is_callable($filter)) {
throw new \WebLoader\InvalidArgumentException('Filter is not callable.');
}

$this->fileFilters[] = $filter;
}

Expand Down
Empty file modified WebLoader/FileCollection.php
100644 → 100755
Empty file.
Empty file modified WebLoader/Filter/PHPCoffeeScriptFilter.php
100644 → 100755
Empty file.
9 changes: 0 additions & 9 deletions WebLoader/IFileCollection.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,9 @@ interface IFileCollection
{
public function getRoot(): string;

/**
* @return array
*/
public function getFiles(): array;

/**
* @return array
*/
public function getRemoteFiles(): array;

/**
* @return array
*/
public function getWatchFiles(): array;
}
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@
"tracy/tracy": "^2.4",
"oyejorge/less.php": "^1.7",
"leafo/scssphp": "^0.7",
"coffeescript/coffeescript": "1.3.*",
"mockery/mockery": "0.7.*",
"phpunit/phpunit": "3.7.*",
"kylekatarnls/coffeescript": "1.3.*",
"mockery/mockery": "1.*",
"phpunit/phpunit": "7.*",
"jakub-onderka/php-parallel-lint": "~0.7"
},
"extra": {
Expand Down
7 changes: 4 additions & 3 deletions tests/CompilerTest.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

use Mockery;
use WebLoader\Compiler;
use PHPUnit\Framework\TestCase;

/**
* CompilerTest
*
* @author Jan Marek
*/
class CompilerTest extends \PHPUnit_Framework_TestCase
class CompilerTest extends TestCase
{

/** @var \WebLoader\Compiler */
Expand Down Expand Up @@ -143,15 +144,15 @@ public function testFileFilters()
}

/**
* @expectedException \WebLoader\InvalidArgumentException
* @expectedException \TypeError
*/
public function testNonCallableFilter()
{
$this->object->addFilter(4);
}

/**
* @expectedException \WebLoader\InvalidArgumentException
* @expectedException \TypeError
*/
public function testNonCallableFileFilter()
{
Expand Down
3 changes: 2 additions & 1 deletion tests/DefaultOutputNamingConventionTest.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

namespace WebLoader\Test;

use PHPUnit\Framework\TestCase;
use WebLoader\DefaultOutputNamingConvention;

/**
* DefaultOutputNamingConvention test
*
* @author Jan Marek
*/
class DefaultOutputNamingConventionTest extends \PHPUnit_Framework_TestCase
class DefaultOutputNamingConventionTest extends TestCase
{

/** @var DefaultOutputNamingConvention */
Expand Down
3 changes: 2 additions & 1 deletion tests/FileCollectionTest.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

namespace WebLoader\Test;

use PHPUnit\Framework\TestCase;
use WebLoader\FileCollection;

/**
* FileCollection test
*
* @author Jan Marek
*/
class FileCollectionTest extends \PHPUnit_Framework_TestCase
class FileCollectionTest extends TestCase
{

/** @var FileCollection */
Expand Down
3 changes: 2 additions & 1 deletion tests/Filter/CssUrlsFilterTest.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

namespace WebLoader\Test\Filter;

use PHPUnit\Framework\TestCase;
use WebLoader\Filter\CssUrlsFilter;

class CssUrlsFilterTest extends \PHPUnit_Framework_TestCase
class CssUrlsFilterTest extends TestCase
{

/** @var CssUrlsFilter */
Expand Down
3 changes: 2 additions & 1 deletion tests/Filter/LessFilterTest.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@

namespace WebLoader\Test\Filter;

use PHPUnit\Framework\TestCase;
use WebLoader\Compiler;
use WebLoader\DefaultOutputNamingConvention;
use WebLoader\FileCollection;
use WebLoader\Filter\LessFilter;

class LessFilterTest extends \PHPUnit_Framework_TestCase
class LessFilterTest extends TestCase
{
/** @var LessFilter */
private $filter;
Expand Down
3 changes: 2 additions & 1 deletion tests/Filter/PHPCoffeeScriptFilterTest.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

namespace WebLoader\Test\Filter;

use PHPUnit\Framework\TestCase;
use WebLoader\Filter\PHPCoffeeScriptFilter;

/**
* CompilerTest
*
* @author Jan Svantner
*/
class PHPCoffeeScriptFilterTest extends \PHPUnit_Framework_TestCase
class PHPCoffeeScriptFilterTest extends TestCase
{

/** @var PHPCoffeeScriptFilter */
Expand Down
3 changes: 2 additions & 1 deletion tests/Filter/ScssFilterTest.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@

namespace WebLoader\Test\Filter;

use PHPUnit\Framework\TestCase;
use WebLoader\Compiler;
use WebLoader\DefaultOutputNamingConvention;
use WebLoader\FileCollection;
use WebLoader\Filter\ScssFilter;
use WebLoader\Filter\VariablesFilter;

class ScssFilterTest extends \PHPUnit_Framework_TestCase
class ScssFilterTest extends TestCase
{
/** @var ScssFilter */
private $filter;
Expand Down
3 changes: 2 additions & 1 deletion tests/Filter/VariablesFilterTest.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

namespace WebLoader\Test\Filter;

use PHPUnit\Framework\TestCase;
use WebLoader\Filter\VariablesFilter;

class VariablesFilterTest extends \PHPUnit_Framework_TestCase
class VariablesFilterTest extends TestCase
{

/** @var VariablesFilter */
Expand Down
3 changes: 2 additions & 1 deletion tests/Nette/ExtensionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@

namespace WebLoader\Test\Nette;

use PHPUnit\Framework\TestCase;
use WebLoader\Path;
use Nette\Utils\Finder;


class ExtensionTest extends \PHPUnit_Framework_TestCase
class ExtensionTest extends TestCase
{

/** @var \Nette\DI\Container */
Expand Down
3 changes: 2 additions & 1 deletion tests/Path/PathTest.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@

namespace WebLoader\Test\Path;

use PHPUnit\Framework\TestCase;
use WebLoader\Path;

class PathTest extends \PHPUnit_Framework_TestCase
class PathTest extends TestCase
{

public function testNormalize()
Expand Down

0 comments on commit 6269bd6

Please sign in to comment.