for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace JoshGaber\NovaUnit\Actions;
use Laravel\Nova\Actions\Action;
use PHPUnit\Framework\Assert as PHPUnit;
class MockActionElement
{
private $action;
public function __construct(Action $action)
$this->action = $action;
}
/**
* Assert that the action can be shown on the index view.
*
* @param string $message
* @return $this
*/
public function assertShownOnIndex(string $message = ''): self
PHPUnit::assertTrue($this->action->showOnIndex, $message);
return $this;
* Assert that the action is hidden from the index view.
public function assertHiddenFromIndex(string $message = ''): self
PHPUnit::assertFalse($this->action->showOnIndex, $message);
* Assert that the action can be shown on the detail view.
public function assertShownOnDetail(string $message = ''): self
PHPUnit::assertTrue($this->action->showOnDetail, $message);
* Assert that the action is hidden from the detail view.
public function assertHiddenFromDetail(string $message = ''): self
PHPUnit::assertFalse($this->action->showOnDetail, $message);
* Assert that the action can be shown on table rows.
public function assertShownOnTableRow(string $message = ''): self
PHPUnit::assertTrue($this->action->showOnTableRow, $message);
* Assert that the action is hidden from table rows.
public function assertHiddenFromTableRow(string $message = ''): self
PHPUnit::assertFalse($this->action->showOnTableRow, $message);