for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Magium\Twitter\Actions;
use Magium\Twitter\Themes\Twitter;
use Magium\WebDriver\ExpectedCondition;
use Magium\WebDriver\WebDriver;
class Tweet
{
const ACTION = 'Magium\Twitter\Actions\Tweet';
protected $theme;
protected $webDriver;
public function __construct(
Twitter $theme,
WebDriver $webDriver
)
$this->theme = $theme;
$this->webDriver = $webDriver;
}
public function tweet($text)
$element = $this->webDriver->byXpath($this->theme->getTweetBoxXpath());
$element->click();
$this->webDriver->getKeyboard()->sendKeys($text);
$this->webDriver->wait(5)->until(ExpectedCondition::elementExists($this->theme->getTweetButton(), WebDriver::BY_XPATH));
\Magium\WebDriver\Expect...er\WebDriver::BY_XPATH)
object<Facebook\WebDrive...riverExpectedCondition>
callable
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example:
function acceptsInteger($int) { } $x = '123'; // string "123" // Instead of acceptsInteger($x); // we recommend to use acceptsInteger((integer) $x);
$element = $this->webDriver->byXpath($this->theme->getTweetButton());
$this->webDriver->wait(5)->until(ExpectedCondition::visibilityOf($element));
\Magium\WebDriver\Expect...:visibilityOf($element)
object<Magium\WebDriver\ExpectedCondition>
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: