for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Redaxscript\Tests;
use Facebook\WebDriver\WebDriverBy;
use Redaxscript\Console\Command;
/**
* ConsoleTest
*
* @since 4.0.0
* @package Redaxscript
* @category Tests
* @author Henry Ruhs
*/
class ConsoleTest extends TestCaseAbstract
{
* setUp
public function setUp() : void
parent::setUp();
$this->_driver->get('http://localhost:8000/console.php');
}
* testTitle
public function testTitle() : void
/* expect and actual */
$expect = $this->_language->get('console');
$actual = $this->_driver->getTitle();
/* compare */
$this->assertEquals($expect, $actual);
* testBehaviour
public function testBehaviour() : void
/* setup */
$helpCommand = new Command\Help($this->_registry, $this->_request, $this->_language, $this->_config);
$formElement = $this->_driver->findElement(WebDriverBy::tagName('form'));
$promptElement = $formElement->findElement(WebDriverBy::id('prompt'));
$boxElement = $this->_driver->findElement(WebDriverBy::id('box'));
$this->assertNotTrue($boxElement->getText());
/* interact and compare */
$promptElement->sendKeys('help');
$formElement->submit();
$boxElement->isDisplayed();
$this->assertStringContainsString($helpCommand->getHelp(), $boxElement->getAttribute('textContent'));