Skip to content

Commit

Permalink
Broken tests
Browse files Browse the repository at this point in the history
Reverted changes in tests and will try again
  • Loading branch information
DepkaCZ committed Jul 16, 2018
1 parent 26ef015 commit 11c1e68
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 18 deletions.
2 changes: 1 addition & 1 deletion src/Application/VerifierPresenterTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function getVerifier(): Verifier
*
* @return bool
*/
protected function tryCall(string $method, array $parameters): bool
protected function tryCall($method, array $parameters): bool
{
$called = parent::tryCall($method, $parameters);
if (!$called && substr($method, 0, 6) === 'action') {
Expand Down
4 changes: 1 addition & 3 deletions tests/functional/src/Classes/BlockControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@ public function render(): void

/**
* @Enabled( "$parameter" )
*
* @param string $parameter
*/
public function handleSignal(string $parameter): void
public function handleSignal($parameter): void
{
$this->template->message = 'Signal called!';
}
Expand Down
4 changes: 1 addition & 3 deletions tests/functional/src/Classes/ChildControl.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ class ChildControl extends Control

/**
* @Enabled( "$parameter" )
*
* @param string $parameter
*/
public function handleSignal1(string $parameter): void
public function handleSignal1($parameter): void
{
$this->redirectVerified('signal2!');
}
Expand Down
1 change: 0 additions & 1 deletion tests/functional/src/Classes/Enabled.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@
*/
class Enabled extends SecurityRule
{
/** @var string|bool */
public $value;
}
2 changes: 1 addition & 1 deletion tests/functional/src/Classes/EnabledRuleHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function checkRule(RuleInterface $rule, Request $request, ?string $compon

if (is_string($rule->value)) {
$parameters = $request->getParameters();
$parameter = ((bool) $component ? $component.'-' : '').ltrim($rule->value, '$');
$parameter = ($component ? $component.'-' : '').ltrim($rule->value, '$');
$enabled = isset($parameters[$parameter]) && (bool) $parameters[$parameter];
} else {
$enabled = $rule->value;
Expand Down
14 changes: 7 additions & 7 deletions tests/functional/src/RuleHandlersTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testEitherFirst(): void
]
);

self::assertTrue($this->verifier->isLinkVerified($request, new TestPresenter()));
$this->assertTrue($this->verifier->isLinkVerified($request, new TestPresenter()));
}

public function testEitherSecond(): void
Expand All @@ -54,7 +54,7 @@ public function testEitherSecond(): void
]
);

self::assertTrue($this->verifier->isLinkVerified($request, new TestPresenter()));
$this->assertTrue($this->verifier->isLinkVerified($request, new TestPresenter()));
}

public function testEitherFalse(): void
Expand All @@ -67,7 +67,7 @@ public function testEitherFalse(): void
]
);

self::assertFalse($this->verifier->isLinkVerified($request, new TestPresenter()));
$this->assertFalse($this->verifier->isLinkVerified($request, new TestPresenter()));
}

public function testEitherInner(): void
Expand All @@ -80,7 +80,7 @@ public function testEitherInner(): void
]
);

self::assertFalse($this->verifier->isLinkVerified($request, new TestPresenter()));
$this->assertFalse($this->verifier->isLinkVerified($request, new TestPresenter()));
}

public function testAllTrue(): void
Expand All @@ -93,7 +93,7 @@ public function testAllTrue(): void
]
);

self::assertTrue($this->verifier->isLinkVerified($request, new TestPresenter()));
$this->assertTrue($this->verifier->isLinkVerified($request, new TestPresenter()));
}

public function testAllFalse(): void
Expand All @@ -106,7 +106,7 @@ public function testAllFalse(): void
]
);

self::assertFalse($this->verifier->isLinkVerified($request, new TestPresenter()));
$this->assertFalse($this->verifier->isLinkVerified($request, new TestPresenter()));
}

public function testAllInner(): void
Expand All @@ -119,6 +119,6 @@ public function testAllInner(): void
]
);

self::assertTrue($this->verifier->isLinkVerified($request, new TestPresenter()));
$this->assertTrue($this->verifier->isLinkVerified($request, new TestPresenter()));
}
}
1 change: 0 additions & 1 deletion tests/unit/src/Classes/TestPresenter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
class TestPresenter extends Presenter
{
/**
* @var string
* @TestRule
*/
public $property;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/src/VerifierTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ public function testInvalidRule(): void

try {
$this->verifier->isLinkVerified($request, $component);
self::fail();
$this->fail();
} catch (UnexpectedTypeException $e) {
}

Expand Down

0 comments on commit 11c1e68

Please sign in to comment.