for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace JoshGaber\NovaUnit\Traits;
use Illuminate\Http\Request;
use JoshGaber\NovaUnit\Constraints\ArrayHasInstanceOf;
use JoshGaber\NovaUnit\Constraints\HasValidFields;
use PHPUnit\Framework\Assert as PHPUnit;
trait ActionAssertions
{
/**
* Asserts that this component has the specified field.
*
* @param string $action The class path of the Action
* @param string $message
* @return $this
*/
public function assertHasAction(string $action, string $message = ''): self
PHPUnit::assertThat(
$this->component->actions(Request::createFromGlobals()),
new ArrayHasInstanceOf($action),
$message
);
return $this;
}
* Asserts that this component does not have the specified field.
public function assertActionMissing(string $action, string $message = ''): self
PHPUnit::logicalNot(new ArrayHasInstanceOf($action)),
* Asserts that this component has no Actions specified.
public function assertHasNoActions(string $message = ''): self
PHPUnit::assertCount(0, $this->component->fields(Request::createFromGlobals()), $message);
* Asserts that all actions on this component are valid Actions.
public function assertHasValidActions(string $message = ''): self
$this->component->fields(Request::createFromGlobals()),
new HasValidFields(),