Started adding HookHelper and tests but the tests aren't working
This commit is contained in:
parent
797da77803
commit
22640f02b6
9
modules/opencase_cases/src/Helper/HookHelper.php
Normal file
9
modules/opencase_cases/src/Helper/HookHelper.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Drupal\opencase_cases\Helper;
|
||||||
|
|
||||||
|
class HookHelper {
|
||||||
|
public static function onCaseFeeUpdate(\Drupal\opencase_cases\Entity\OCCaseFee $caseFee) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
16
tests/src/Unit/HookHelperTest.php
Normal file
16
tests/src/Unit/HookHelperTest.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?php declare(strict_types=1);
|
||||||
|
use PHPUnit\Framework\TestCase;
|
||||||
|
include '../../../modules/opencase_cases/src/Entity/OCCase.php';
|
||||||
|
|
||||||
|
final class HookHelperTest extends TestCase
|
||||||
|
{
|
||||||
|
public function testOnCaseFeeUpdate(): void
|
||||||
|
{
|
||||||
|
$caseStub = $this->createStub(\Drupal\opencase_cases\Entity\OCCase::class);
|
||||||
|
$caseStub->total_fee = 5;
|
||||||
|
$caseFeeStub = $this->createStub(\Drupal\opencase_cases\Entity\OCCaseFee::class);
|
||||||
|
$caseFeeStub->amount = 10;
|
||||||
|
$caseFeeStub->method('getCase')->will($this->returnValue($caseStub));
|
||||||
|
$this->assertSame(5,5);
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user