Skip to content
Browse files

Merge branch 'release/3.0.1'

  • Loading branch information...
2 parents 4912e72 + 8f6a518 commit 7ea3b00da008ad1b79417206eb5d79d26d518a37 @everzet everzet committed
Showing with 29 additions and 22 deletions.
  1. +7 −0 CHANGES.md
  2. +1 −1 README.md
  3. +1 −1 src/Behat/Mink/Integration/support/hooks.php
  4. +10 −10 src/Behat/Mink/Mink.php
  5. +9 −9 tests/Behat/Mink/MinkTest.php
  6. +1 −1 vendor/SahiClient
View
7 CHANGES.md
@@ -1,4 +1,11 @@
+0.3.1 / 2011-05-17
+==================
+
+ * Small SahiClient update (it generates SID now if no provided)
+ * setActiveSessionName => setDefaultSessionName method rename
+
0.3.0 / 2011-05-17
+==================
* Rewritten from scratch Mink drivers handler. Now it's sessions handler. And Mink now
sessions-centric tool. See examples in readme. Much cleaner API now.
View
2 README.md
@@ -25,7 +25,7 @@ $mink = new Mink(
);
// set active session name
-$mink->setActiveSessionName('goutte2');
+$mink->setDefaultSessionName('goutte2');
// call getSession without argument will always return active session if has one (goutte2 here)
$mink->getSession()->getPage()->findLink('Downloads')->click();
View
2 src/Behat/Mink/Integration/support/hooks.php
@@ -23,7 +23,7 @@
}
}
- $environment->getMink()->setActiveSessionName(
+ $environment->getMink()->setDefaultSessionName(
$session ?: ($environment->getParameter('default_driver') ?: 'goutte')
);
View
20 src/Behat/Mink/Mink.php
@@ -20,7 +20,7 @@
*/
class Mink
{
- private $activeSessionName;
+ private $defaultSessionName;
private $sessions = array();
/**
@@ -69,11 +69,11 @@ public function hasSession($name)
}
/**
- * Sets active session name to use.
+ * Sets default session name to use.
*
- * @param null|string $name name of the registered session
+ * @param string $name name of the registered session
*/
- public function setActiveSessionName($name)
+ public function setDefaultSessionName($name)
{
$name = strtolower($name);
@@ -81,17 +81,17 @@ public function setActiveSessionName($name)
throw new \InvalidArgumentException(sprintf('session "%s" is not registered.', $name));
}
- $this->activeSessionName = $name;
+ $this->defaultSessionName = $name;
}
/**
- * Returns currently active session name or null if none.
+ * Returns default session name or null if none.
*
* @return null|string
*/
- public function getActiveSessionName()
+ public function getDefaultSessionName()
{
- return $this->activeSessionName;
+ return $this->defaultSessionName;
}
/**
@@ -103,7 +103,7 @@ public function getActiveSessionName()
*/
public function getSession($name = null)
{
- $name = strtolower($name) ?: $this->activeSessionName;
+ $name = strtolower($name) ?: $this->defaultSessionName;
if (null === $name) {
throw new \InvalidArgumentException('specify session name to get');
@@ -118,7 +118,7 @@ public function getSession($name = null)
// start session if needed
if (!$session->isStarted()) {
$session->start();
- $this->activeSessionName = $name;
+ $this->defaultSessionName = $name;
}
return $session;
View
18 tests/Behat/Mink/MinkTest.php
@@ -87,22 +87,22 @@ public function testGetAlreadyStartedSession()
$this->assertSame($session, $this->mink->getSession('mock_session'));
}
- public function testSetActiveSessionName()
+ public function testSetDefaultSessionName()
{
- $this->assertNull($this->mink->getActiveSessionName());
+ $this->assertNull($this->mink->getDefaultSessionName());
$session = $this->getSessionMock();
$this->mink->registerSession('session_name', $session);
- $this->mink->setActiveSessionName('session_name');
+ $this->mink->setDefaultSessionName('session_name');
- $this->assertEquals('session_name', $this->mink->getActiveSessionName());
+ $this->assertEquals('session_name', $this->mink->getDefaultSessionName());
$this->setExpectedException('InvalidArgumentException');
- $this->mink->setActiveSessionName('not_registered');
+ $this->mink->setDefaultSessionName('not_registered');
}
- public function testGetActiveSession()
+ public function testGetDefaultSession()
{
$session1 = $this->getSessionMock();
$session2 = $this->getSessionMock();
@@ -111,18 +111,18 @@ public function testGetActiveSession()
$this->mink->registerSession('session_1', $session1);
$this->mink->registerSession('session_2', $session2);
- $this->mink->setActiveSessionName('session_2');
+ $this->mink->setDefaultSessionName('session_2');
$this->assertSame($session1, $this->mink->getSession('session_1'));
$this->assertSame($session2, $this->mink->getSession('session_2'));
$this->assertSame($session2, $this->mink->getSession());
- $this->mink->setActiveSessionName('session_1');
+ $this->mink->setDefaultSessionName('session_1');
$this->assertSame($session1, $this->mink->getSession());
}
- public function testGetNoActiveSession()
+ public function testGetNoDefaultSession()
{
$session1 = $this->getSessionMock();
2 vendor/SahiClient
@@ -1 +1 @@
-Subproject commit 861e1afa53e694a010776cf78ac61ad267aeff2c
+Subproject commit f08c1fa689f0b7035c30aa3523ce362449537091

0 comments on commit 7ea3b00

Please sign in to comment.
Something went wrong with that request. Please try again.