for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace hipanel\modules\finance\tests\acceptance\manager;
use hipanel\helpers\Url;
use hipanel\modules\finance\tests\_support\Page\plan\Create as PlanCreatePage;
use hipanel\modules\finance\tests\_support\Page\price\certificate\Create as PriceCertificateCreate;
use hipanel\modules\finance\tests\_support\Page\price\certificate\Update as PriceCertificateUpdate;
use hipanel\tests\_support\Step\Acceptance\Manager;
class CertificateCrudCest
{
/**
* @var string
*/
private $id;
* @var array
private $fields;
public function ensureThatICanCreateTariffPlan(Manager $I): void
$this->fields = [
'name' => uniqid(),
'type' => 'Certificate tariff',
'client' => '[email protected]',
'currency' => 'USD',
'note' => 'test note',
];
$page = new PlanCreatePage($I, $this->fields);
$this->id = $page->createPlan();
$id
string
$page->createPlan()
integer
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.
$answer = 42; $correct = false; $correct = (bool) $answer;
}
public function ensureThatICanAddPrices(Manager $I)
$I->needPage(Url::to(['@plan/view', 'id' => $this->id]));
$I->see('No prices found');
$price = new PriceCertificateCreate($I, $this->id);
$price->addPrices('Certificate tariff');
$price->ensureThereNoSuggestions('Certificate tariff');
public function ensureICanUpdatePrices(Manager $I)
$price = new PriceCertificateUpdate($I, $this->id);
$price->updatePrices();
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.