Slide 16
Slide 16 text
exec('DELETE FROM person_trade');
$connection->exec('DELETE FROM person');
$session = new \Behat\Mink\Session(new \Behat\Mink\Driver\GoutteDriver());
$this->mink = new \Behat\Mink\Mink(['default' => $session]);
$this->mink->setDefaultSessionName('default');
}
/**
* @test
*/
function shouldAllowToDefineContactPersonInformation()
{
$session = $this->mink->getSession();
$session->visit('http://localhost/index.php?a=managePersonAdd');
$currentPage = $session->getPage();
$currentPage->fillField('name', 'Leszek');
$currentPage->fillField('surname', 'Prabucki');
$currentPage->attachFileToField('cv', __DIR__.'/pathtocv.pdf');
$currentPage->pressButton('Dodaj');
$currentPage = $session->getPage();
$assertSession = $this->mink->assertSession();
$assertSession->addressMatches('#a=managerPersonDetails#');
$this->assertEquals('Leszek', $currentPage->findField('name')->getValue());
$this->assertEquals('Prabucki', $currentPage->findField('surname')->getValue());
}
}
Modyfikacje kodu legacy
- test first