Skip to content
Permalink
Browse files

//

  • Loading branch information
rodolfoberrios committed Feb 19, 2020
1 parent 5811ddf commit 69b4c7552a60fad3d3d15032f6c4eccbe098a6c3
@@ -35,5 +35,5 @@
new BootstrapInstance($bootstrap);

require 'runtime.php';
require $bootstrap->appDir() . 'app.php';
require $bootstrap->appDir() . 'loader.php';
require $bootstrap->appDir()->path()->absolute() . 'app.php';
require $bootstrap->appDir()->path()->absolute() . 'loader.php';
@@ -61,6 +61,7 @@ public function testWithRemovedItems(): void
{
$items = $this->getiItems();
$breadcrum = new Breadcrum();
$pos = 0;
foreach ($items as $pos => $item) {
$breadcrum = $breadcrum
->withAddedItem($item)
@@ -13,16 +13,16 @@

namespace Chevere\Components\Hooks;

final class HooksRegister
{
public function add(
string $className,
string $anchor,
int $priority,
string $file
) {
}
}
// final class HooksRegister
// {
// public function add(
// string $className,
// string $anchor,
// int $priority,
// string $file
// ) {
// }
// }

// $registerHooks = new HooksRegister();
// $registerHooks->add('className', 'anchor', 0, )
@@ -23,11 +23,10 @@ final class RequestTest extends TestCase
{
public function testConstruct(): void
{
$request =
new Request(
new Method('GET'),
new PathUri('/')
);
$request = new Request(
new Method('GET'),
new PathUri('/')
);
$globals = new Globals([]);
$this->assertSame($globals->globals(), $request->globals()->globals());
}
@@ -42,15 +41,14 @@ public function testConstructAllArguments(): void
'cookie' => ['cookie'],
'session' => ['session'],
];
$request =
new Request(
new Method('GET'),
new PathUri('/'),
['headers'],
'body request',
'1.1',
$globs['server']
);
new Request(
new Method('GET'),
new PathUri('/'),
['headers'],
'body request',
'1.1',
$globs['server']
);
// $globals = $request->globals();
// xdd($globals);
// $this->assertSame();
@@ -49,7 +49,7 @@ public function testConstruct(): void
public function testNotExportable(): void
{
$route = new Route(new PathUri('/test'));
/** @scrutinizer ignore-call */ $route->resource = fopen('php://output', 'r');
$route->resource = fopen('php://output', 'r');
$this->expectException(RouteNotRouteableException::class);
new Routeable($route);
}
@@ -42,7 +42,7 @@ public function setUp(): void

public function testEmptyCache(): void
{
$routerCache = new RouterCache($this->helper->getEmptyCache());
$routerCache = new RouterCache($this->cacheHelper->getEmptyCache());
$this->assertEmpty($routerCache->puts());
$this->assertFalse($routerCache->hasRegex());
$this->assertFalse($routerCache->hasIndex());
@@ -54,28 +54,28 @@ public function testEmptyCache(): void

public function testGetEmptyRegex(): void
{
$routerCache = new RouterCache($this->helper->getEmptyCache());
$routerCache = new RouterCache($this->cacheHelper->getEmptyCache());
$this->expectException(RouterCacheNotFoundException::class);
$routerCache->getRegex();
}

public function testGetEmptyIndex(): void
{
$routerCache = new RouterCache($this->helper->getEmptyCache());
$routerCache = new RouterCache($this->cacheHelper->getEmptyCache());
$this->expectException(RouterCacheNotFoundException::class);
$routerCache->getIndex();
}

public function testGetEmptyNamed(): void
{
$routerCache = new RouterCache($this->helper->getEmptyCache());
$routerCache = new RouterCache($this->cacheHelper->getEmptyCache());
$this->expectException(RouterCacheNotFoundException::class);
$routerCache->getNamed();
}

public function testGetEmptyGroups(): void
{
$routerCache = new RouterCache($this->helper->getEmptyCache());
$routerCache = new RouterCache($this->cacheHelper->getEmptyCache());
$this->expectException(RouterCacheNotFoundException::class);
$routerCache->getGroups();
}
@@ -84,7 +84,7 @@ public function testWorkingCache(): void
{
$router = new Router(
new RouteCache(
$this->helper->getWorkingCache()
$this->cacheHelper->getWorkingCache()
)
);
$regex = new RouterRegex(
@@ -104,7 +104,7 @@ public function testWorkingCache(): void
->withIndex($index)
->withNamed($named)
->withGroups($groups);
$routerCache = new RouterCache($this->helper->getWorkingCache());
$routerCache = new RouterCache($this->cacheHelper->getWorkingCache());
$routerCache->put($router);
$this->assertTrue($routerCache->hasRegex());
$this->assertTrue($routerCache->hasIndex());
@@ -47,15 +47,11 @@ public function testConstruct(): void

public function testWithAdded(): void
{
$args = [
new PathUri('/path'),
0,
'some-group',
'some-name'
];
$patUri = new PathUri('/path');
$id = 0;
$routerIndex = (new RouterIndex())
->withAdded(/** @scrutinizer ignore-type */...$args);
$this->assertTrue($routerIndex->has($args[0]));
$this->assertIsArray($routerIndex->get($args[0]));
->withAdded($patUri, $id, 'some-group', 'some-name');
$this->assertTrue($routerIndex->has($patUri));
$this->assertIsArray($routerIndex->get($patUri));
}
}
@@ -76,7 +76,7 @@ private function restoreHandler(): void
$this->handler = $setFn(fn () => '');
try {
$this->value = (string) $this->handler;
} catch (Throwable $e) {/** @scrutinizer ignore-call */
} catch (Throwable $e) {
$this->value = '@';
}
$restoreFn();
@@ -69,8 +69,8 @@ public function testConsoleOutputter(): void
$varOutputter->process(new ConsoleOutputter);
$parsed = $this->getParsed($backtrace, 'output-console-color');
$string = $writer->toString();
if ((new ConsoleColor())->isSupported() === false) {
}
// if ((new ConsoleColor())->isSupported() === false) {
// }
$parsed = (string) (new Str($parsed))->stripANSIColors();
$string = (string) (new Str($string))->stripANSIColors();
$this->assertSame($parsed, $string);
@@ -15,7 +15,6 @@

use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Chevere\Components\Console\Console;
use Chevere\Components\App\Interfaces\BuilderInterface;

interface CommandInterface

0 comments on commit 69b4c75

Please sign in to comment.
You can’t perform that action at this time.