Skip to content

Commit

Permalink
Adding Additional Test - Adjusting To Public But Not Called As Test
Browse files Browse the repository at this point in the history
  • Loading branch information
Fenikkusu committed Feb 7, 2025
1 parent 8f527d8 commit 27322c0
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/unit/Dispatcher/CallActionMethodCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function dispatcherCallActionMethod(UnitTester $I)

$dispatcher->callActionMethod(
$this,
'wasCalled'
'_wasCalled'
);

$I->assertTrue($this->wasCalled);
Expand All @@ -68,15 +68,15 @@ public function dispatcherCallActionMethodWithParams(UnitTester $I)

$dispatcher->callActionMethod(
$this,
'paramCalled',
'_paramCalled',
[
'something'
'something' => 'else'
]
);

$I->assertFalse($this->wasCalled);
$I->assertFalse($this->altCalled);
$I->assertEquals('something', $this->paramCalled);
$I->assertEquals('else', $this->paramCalled);
}

/**
Expand All @@ -93,7 +93,7 @@ public function dispatcherCallActionMethodWithEvents(UnitTester $I)
$eventsManager->attach(
'dispatch:beforeCallAction',
function (Event $event, Dispatcher $dispatcher, Collection $observer) {
$observer->action = "altCalled";
$observer->action = "_altCalled";
}
);

Expand All @@ -103,24 +103,24 @@ function (Event $event, Dispatcher $dispatcher, Collection $observer) {

$dispatcher->callActionMethod(
$this,
'wasCalled'
'_wasCalled'
);

$I->assertTrue($this->altCalled);
$I->assertFalse($this->wasCalled);
}

public function wasCalled(): void
public function _wasCalled(): void
{
$this->wasCalled = true;
}

public function altCalled(): void
public function _altCalled(): void
{
$this->altCalled = true;
}

public function paramCalled(string $param): void
public function _paramCalled(string $param): void
{
$this->paramCalled = $param;
}
Expand Down

0 comments on commit 27322c0

Please sign in to comment.