diff --git a/i18n/ru.xliff b/i18n/ru.xliff
index 139a0a8..aa40ebb 100755
--- a/i18n/ru.xliff
+++ b/i18n/ru.xliff
@@ -2,105 +2,109 @@
+
+
+
+
- [^"]*)" smtp server with "(?P[^"]*)" and "(?P[^"]*)"$/]]>
- [^"]*)" почтовом smtp сервере с "(?P[^"]*)" и "(?P[^"]*)"$/]]>
+
+
-
-
-
-
-
-
+
+
-
-
-
+
+
+
- (?:[^"]|\\")*)"$/]]>
- (?:[^"]|\\")*)"$/]]>
+
+
- (?:[^"]|\\")*)" and attach "(?P(?:[^"]|\\")*)"$/]]>
- (?:[^"]|\\")*)" и вложением "(?P(?:[^"]|\\")*)"$/]]>
+
+
- (?:[^"]|\\")*)" and body "(?P(?:[^"]|\\")*)" to address "(?P(?:[^"]|\\")*)" from "(?P(?:[^"]|\\")*)"$/]]>
- (?:[^"]|\\")*)" и текстом "(?P(?:[^"]|\\")*)" по адресу "(?P(?:[^"]|\\")*)" от "(?P(?:[^"]|\\")*)"$/]]>
+
+
-
-
+
+
- (?:[^"]|\\")*)"$/]]>
- (?:[^"]|\\")*)"$/]]>
+
+
- (?:[^"]|\\")*)"$/]]>
- (?:[^"]|\\")*)"$/]]>
+
+
-
- (?:[^"]|\\")*)" mail message$/]]>
- (?:[^"]|\\")*)"$/]]>
+
+
+
- (?:[^"]|\\")*)" in recipients$/]]>
- (?:[^"]|\\")*)"$/]]>
+
+
-
-
+
+
-
- \d+) new mail messag(e|es) after (?P
- \d+) нов(ых|ое) пис(ем|ьма|ьмо) через (?P
+
+
+
- \d+) new mail messag(e|es) after waiting$/]]>
- \d+) нов(ых|ое) пис(ем|ьма|ьмо)$/]]>
+
+
+
+
+
+
- \d+) messag(e|es)$/]]>
- \d+) пис(ем|ьма|ьмо)$/]]>
+
+
- (?:[^"]|\\")*)" in subject$/]]>
- (?:[^"]|\\")*)" в теме$/]]>
+
+
- (?:[^"]|\\")*)"$/]]>
- (?:[^"]|\\")*)"$/]]>
+
+
- (?:[^"]|\\")*)" in mail message$/]]>
- (?:[^"]|\\")*)" в письме$/]]>
+
+
- (?:[^"]|\\")*)" as reply address in mail message$/]]>
- (?:[^"]|\\")*)" в адресе отправителя письма$/]]>
+
+
- (?:[^"]|\\")*)" in recipients$/]]>
- (?:[^"]|\\")*)"$/]]>
+
+
- (?:[^"]|\\")*)" in mail message$/]]>
- (?:[^"]|\\")*)"$/]]>
+
+
-
-
+
+
- (?:[^"]|\\")*)" from mail message$/]]>
- (?:[^"]|\\")*)" из письма$/]]>
+ (?:[^"]|\\")*)" from mail message]]>
+ (?:[^"]|\\")*)" из письма]]>
- (?:[^"]|\\")*)" by pattern "(?P(?:[^"]|\\")*)" from mail body$/]]>
- (?:[^"]|\\")*)" по шаблону "(?P(?:[^"]|\\")*)" из тела письма$/]]>
+ (?:[^"]|\\")*)" by pattern "(?P(?:[^"]|\\")*)" from mail body]]>
+ (?:[^"]|\\")*)" по шаблону "(?P(?:[^"]|\\")*)" из тела письма]]>
diff --git a/src/Staffim/Behat/MailExtension/Context/ExtendedMailContext.php b/src/Staffim/Behat/MailExtension/Context/ExtendedMailContext.php
index 3dacc99..ec6c68d 100644
--- a/src/Staffim/Behat/MailExtension/Context/ExtendedMailContext.php
+++ b/src/Staffim/Behat/MailExtension/Context/ExtendedMailContext.php
@@ -2,6 +2,7 @@
namespace Staffim\Behat\MailExtension\Context;
+use Behat\Behat\Context\SnippetAcceptingContext;
use Staffim\Behat\MailExtension\Account;
use Staffim\Behat\MailExtension\Exception\MailboxException;
use Staffim\Behat\MailExtension\Exception\MessageException;
@@ -10,13 +11,13 @@
* Additional steps for sending mail.
*/
// TODO This class may not works correctly for now. Fix it.
-class ExtendedMailContext extends RawMailContext
+class ExtendedMailContext extends RawMailContext implements SnippetAcceptingContext
{
/**
- * @When /^(?:|I )sign in to "(?P[^"]*)" smtp server with "(?P[^"]*)" and "(?P[^"]*)"$/
+ * @When sign in to :smtpServer with :login and :password
*/
// TODO Refactor: extract port to separate parameter, think about whole step.
- public function iSignInToSmtpServer($mailServer, $login, $password)
+ public function iSignInToSmtpServerWithLoginAndPassword($mailServer, $login, $password)
{
list($mailServer, $port) = explode(':', $mailServer) + [null, null];
@@ -25,7 +26,7 @@ public function iSignInToSmtpServer($mailServer, $login, $password)
}
/**
- * @When /^(?:|I )sign out from mail server$/
+ * @When sign out from mail server
*/
public function iSignOutFromMailServer()
{
@@ -33,7 +34,7 @@ public function iSignOutFromMailServer()
}
/**
- * @When /^(?:|I )remove mail from the server$/
+ * @When I remove mail from the server
*/
public function iRemoveMailMessages()
{
@@ -41,8 +42,8 @@ public function iRemoveMailMessages()
}
/**
- * @When /^(?:|I )reply with "(?P(?:[^"]|\\")*)"$/
- * @When /^(?:|I )reply with "(?P(?:[^"]|\\")*)" and attach "(?P(?:[^"]|\\")*)"$/
+ * @When I reply with :text
+ * @When I reply with :text and attach :filename
*/
public function iReplyWithMessage($text, $filename = null)
{
@@ -54,16 +55,16 @@ public function iReplyWithMessage($text, $filename = null)
}
/**
- * @When /^(?:|I )send mail with subject "(?P(?:[^"]|\\")*)" and body "(?P(?:[^"]|\\")*)" to address "(?P(?:[^"]|\\")*)" from "(?P(?:[^"]|\\")*)"$/
+ * @When I send mail with :subject and :body to :address from :sender
*/
- public function iSendMail($subject, $body, $to, $from)
+ public function iSendMail($subject, $body, $address, $sender)
{
- $mail = $this->getMailAgent()->createMessage($subject, $body, $from, $to);
+ $mail = $this->getMailAgent()->createMessage($subject, $body, $sender, $address);
$this->getMailAgent()->send($mail);
}
/**
- * @When /^(?:|I )send mail from file "(?P(?:[^"]|\\")*)"$/
+ * @When I send mail from file :filename
*/
public function iSendMailFromFile($filename)
{
@@ -72,7 +73,7 @@ public function iSendMailFromFile($filename)
}
/**
- * @When /^(?:|I )reply with message from file "(?P(?:[^"]|\\")*)"$/
+ * @When I reply with message from file :filename
*/
public function iReplyWithMessageFromFile($filename)
{
@@ -81,12 +82,12 @@ public function iReplyWithMessageFromFile($filename)
}
/**
- * @Then /^(?:|I )should see "(?P\d+)" messag(e|es)$/
+ * @Then I should see :count messag(e|es)
*/
public function iShouldSeeMailMessages($count)
{
$expectedCount = $count;
- $count = $this->getMailAgent()->getMailbox()->getMessages()->count();
+ $count = $this->getMailAgent()->getMailbox()->getSize();
if ($count !== (int) $expectedCount) {
throw new MailboxException(sprintf('There are %s mail messages, not %s', $count, $expectedCount), $this->getMailAgent()->getMailbox());
@@ -94,7 +95,7 @@ public function iShouldSeeMailMessages($count)
}
/**
- * @Then /^(?:|I )should see attachment "(?P(?:[^"]|\\")*)" in mail message$/
+ * @Then I should see attachment :text in mail message
*/
public function iShouldSeeAttachment($text)
{
diff --git a/src/Staffim/Behat/MailExtension/Context/MailContext.php b/src/Staffim/Behat/MailExtension/Context/MailContext.php
index af955cb..8ac9239 100755
--- a/src/Staffim/Behat/MailExtension/Context/MailContext.php
+++ b/src/Staffim/Behat/MailExtension/Context/MailContext.php
@@ -21,7 +21,7 @@ public function myMailboxIs($address)
}
/**
- * @Then /^(?:|I )should see mail message with "(?P(?:[^"]|\\")*)" in subject$/
+ * @Then I should see mail message with :text in subject
*/
public function iShouldSeeMailMessageWithTextInSubject($text)
{
@@ -32,7 +32,7 @@ public function iShouldSeeMailMessageWithTextInSubject($text)
}
/**
- * @When /^(?:|I )go to "(?P(?:[^"]|\\")*)" mail message$/
+ * @When I go to :subject mail message
*/
public function iGoToMailMessage($subject)
{
@@ -45,7 +45,7 @@ public function iGoToMailMessage($subject)
}
/**
- * @When /^(?:|I )go to mail message with "(?P(?:[^"]|\\")*)" in recipients$/
+ * @When I go to mail message with :address in recipients
*/
public function iGoToMailMessageWithInRecipients($address)
{
@@ -58,7 +58,7 @@ public function iGoToMailMessageWithInRecipients($address)
}
/**
- * @Then /^(?:|I )should see mail message with "(?P(?:[^"]|\\")*)" in recipients$/
+ * @Then I should see mail message with :address in recipients
*/
public function iShouldSeeMailMessageWithAddressInRecepients($address)
{
@@ -71,7 +71,7 @@ public function iShouldSeeMailMessageWithAddressInRecepients($address)
}
/**
- * @Then /^(?:|I )should see mail message with subject "(?P(?:[^"]|\\")*)"$/
+ * @Then I should see mail message with :subject
*/
public function iShouldSeeMailMessageWithSubject($subject)
{
@@ -82,7 +82,7 @@ public function iShouldSeeMailMessageWithSubject($subject)
}
/**
- * @Then /^(?:|I )should see "(?P(?:[^"]|\\")*)" in mail message$/
+ * @Then I should see :text in mail message
*/
public function iShouldSeeInMailMessage($text)
{
@@ -96,8 +96,8 @@ public function iShouldSeeInMailMessage($text)
}
/**
- * @Then /^(?:|I )should see "(?P(?:[^"]|\\")*)" as reply address in mail message$/
- * @Then /^(?:|I )should see "(?P(?:[^"]|\\")*)" sender address$/
+ * @Then I should see :text as reply address in mail message
+ * @Then I should see :text sender address
*/
public function iShouldSeeAsReplyAddress($text)
{
@@ -111,7 +111,7 @@ public function iShouldSeeAsReplyAddress($text)
}
/**
- * @Then /^(?:|I )should see "(?P\d+)" new mail messag(e|es) after "(?P