Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BDD] faq partially #47

Merged
merged 3 commits into from
Oct 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,28 @@ public function iFillCodeWith($code)

/**
* @When I set the position to :position
*
* @param int $position
*/
public function iSetThePositionTo($position)
public function iSetThePositionTo(int $position): void
{

$this->createPage->setPosition($position);
}

/**
* @When I fill the question with :question
*/
public function iFillTheQuestionWith($question)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string $question* 🙂

{
$this->createPage->fillQuestion($question);
}

/**
* @When I set the answer to :answer
*/
public function iSetTheAnswerTo($answer)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string $answer* 🙁

{
$this->createPage->fillAnswer($answer);
}

/**
Expand Down
23 changes: 23 additions & 0 deletions tests/Behat/Page/Admin/FrequentlyAskedQuestion/CreatePage.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,27 @@ public function fillCode(string $code): void
{
$this->getDocument()->fillField('Code', $code);
}
/**
* {@inheritdoc}
*/
public function setPosition(int $position): void
{
$this->getDocument()->fillField('Position', $position);
}

/**
* @inheritDoc
*/
public function fillQuestion(string $question): void
{
$this->getDocument()->fillField('Question', $question);
}

/**
* @inheritDoc
*/
public function fillAnswer(string $answer): void
{
$this->getDocument()->fillField('Answer', $answer);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,19 @@ interface CreatePageInterface extends BaseCreatePageInterface
* @param string $code
*/
public function fillCode(string $code): void;

/**
* @param int $position
*/
public function setPosition(int $position): void;

/**
* @param string $question
*/
public function fillQuestion(string $question): void;

/**
* @param string $answer
*/
public function fillAnswer(string $answer): void;
}