Skip to content

Commit

Permalink
complete lots of unittests
Browse files Browse the repository at this point in the history
  • Loading branch information
phith0n committed May 5, 2019
1 parent fa5723f commit 4edac55
Show file tree
Hide file tree
Showing 17 changed files with 311 additions and 95 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@
/.vscode/
/vendor-bin/
*.phar
/build/
/build/
/website/
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"autoload": {
"psr-4": {"Chip\\": "src/Chip"},
"files": [
"src/Chip/functions.php",
"src/Chip/Schema/FunctionWithCallable.php",
"src/Chip/Schema/DangerFunction.php"
]
Expand All @@ -43,6 +42,7 @@
},
"require-dev": {
"phpunit/phpunit": "^7.0.0",
"mockery/mockery": "^1.2"
"mockery/mockery": "^1.2",
"mikey179/vfsStream": "^1.6"
}
}
74 changes: 60 additions & 14 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 0 additions & 20 deletions src/Chip/Exception/ArgumentsFormatException.php

This file was deleted.

8 changes: 0 additions & 8 deletions src/Chip/Report/HTMLReport.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,4 @@ public function formatCode($vuln)

return implode("\n", $lines);
}

public function formatLevel($level)
{
$sw = [
'critical' => 'danger',
'danger' => '',
];
}
}
3 changes: 0 additions & 3 deletions src/Chip/Visitor/Assert_.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
namespace Chip\Visitor;

use Chip\BaseVisitor;
use function Chip\dump_node;
use Chip\Exception\ArgumentsFormatException;
use Chip\Traits\TypeHelper;
use Chip\Traits\Variable;
use Chip\Traits\Walker\FunctionWalker;
Expand All @@ -30,7 +28,6 @@ class Assert_ extends BaseVisitor

/**
* @param \PhpParser\Node\Expr\FuncCall $node
* @throws ArgumentsFormatException
*/
public function process($node)
{
Expand Down
3 changes: 0 additions & 3 deletions src/Chip/Visitor/CreateFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
namespace Chip\Visitor;

use Chip\BaseVisitor;
use function Chip\dump_node;
use Chip\Exception\ArgumentsFormatException;
use Chip\Traits\TypeHelper;
use Chip\Traits\Variable;
use Chip\Traits\Walker\FunctionWalker;
Expand All @@ -30,7 +28,6 @@ class CreateFunction extends BaseVisitor

/**
* @param FuncCall $node
* @throws ArgumentsFormatException
*/
public function process($node)
{
Expand Down
4 changes: 0 additions & 4 deletions src/Chip/Visitor/FilterVar.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
namespace Chip\Visitor;

use Chip\BaseVisitor;
use function Chip\dump_node;
use Chip\Exception\ArgumentsFormatException;
use Chip\Traits\TypeHelper;
use Chip\Traits\Variable;
use Chip\Traits\Walker\FunctionWalker;
Expand Down Expand Up @@ -84,7 +82,6 @@ class FilterVar extends BaseVisitor

/**
* @param FuncCall $node
* @throws ArgumentsFormatException
*/
public function process($node)
{
Expand All @@ -106,7 +103,6 @@ public function process($node)
* @param FuncCall $node
* @param Arg $filter
* @param Arg $options
* @throws ArgumentsFormatException
*/
protected function filterVar($node, $filter, $options)
{
Expand Down
4 changes: 0 additions & 4 deletions src/Chip/Visitor/MbPregExec.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,9 @@
namespace Chip\Visitor;

use Chip\BaseVisitor;
use Chip\Exception\ArgumentsFormatException;
use Chip\Exception\NodeTypeException;
use Chip\Traits\TypeHelper;
use Chip\Traits\Variable;
use Chip\Traits\Walker\FunctionWalker;
use PhpParser\Node;
use PhpParser\Node\Expr\FuncCall;

class MbPregExec extends BaseVisitor
Expand All @@ -36,7 +33,6 @@ class MbPregExec extends BaseVisitor

/**
* @param FuncCall $node
* @throws ArgumentsFormatException
*/
public function process($node)
{
Expand Down
5 changes: 0 additions & 5 deletions src/Chip/Visitor/PregExec.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,10 @@
namespace Chip\Visitor;

use Chip\BaseVisitor;
use function Chip\dump_node;
use Chip\Exception\ArgumentsFormatException;
use Chip\Exception\NodeTypeException;
use Chip\Exception\RegexFormatException;
use Chip\Structure\Regex;
use Chip\Traits\TypeHelper;
use Chip\Traits\Walker\FunctionWalker;
use PhpParser\Node;
use PhpParser\Node\Expr\FuncCall;

class PregExec extends BaseVisitor
Expand All @@ -34,7 +30,6 @@ class PregExec extends BaseVisitor

/**
* @param FuncCall $node
* @throws ArgumentsFormatException
* @throws RegexFormatException
*/
public function process($node)
Expand Down
3 changes: 0 additions & 3 deletions src/Chip/Visitor/ShellFunction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@
namespace Chip\Visitor;

use Chip\BaseVisitor;
use function Chip\dump_node;
use Chip\Exception\ArgumentsFormatException;
use Chip\Traits\Variable;
use Chip\Traits\Walker\FunctionWalker;
use PhpParser\Node\Expr\FuncCall;
Expand All @@ -34,7 +32,6 @@ class ShellFunction extends BaseVisitor

/**
* @param FuncCall $node
* @throws ArgumentsFormatException
*/
public function process($node)
{
Expand Down
28 changes: 0 additions & 28 deletions src/Chip/functions.php

This file was deleted.

Loading

0 comments on commit 4edac55

Please sign in to comment.