Home » Php » Call a function via arrow operator

Call a function via arrow operator

Posted by: admin October 26, 2017 Leave a comment


I have this code and I don’t understand very well how $ext->click() works. Should be the same if I use $I->click($ext) and if is not, why?
$ext store the 0 position of $elements array. This is what the $ext have inside http://take.ms/pmoAj

$I = new AcceptanceTester($scenario);
$I->wantTo('get the index');
$I->wantTo('Add a new contact');
$I->lookForwardTo('Create a new contact in Alegra');


 $I->amGoingTo('Login into my account');
 $I->fillfield('#email','[email protected]');
 $I->waitForElement('#gridInvoices .action-icons');
  $index = $I->grabMultiple('#gridInvoices .action-icons img:nth-
 $numero = count($index);
 $buscar = array_search('voidInvoice',$index);

if($buscar == false){
   trigger_error('No hay botones del tipo anular facturas');
   $elements = $I->getElements('#gridInvoices #gridview-1047-table tbody tr 
  .action-icons img:nth-child(6)');
   $ext = $elements[$buscar];