Permalink
Browse files

{set,get}SlaveOkay deprecation.

Along with the other deprecations {set,get}SlaveOkay have been removed
with its corresponding tests.
  • Loading branch information...
1 parent fc956c7 commit 681d51c0ce5b785408f5754a5e48d407ced395bc @henrikbjorn henrikbjorn committed with jmikola Nov 28, 2012
View
10 lib/Doctrine/MongoDB/Collection.php
@@ -616,16 +616,6 @@ protected function doSave(array &$a, array $options)
return $this->getMongoCollection()->save($a, $options);
}
- public function setSlaveOkay($ok = true)
@Bilge
Bilge Dec 16, 2012

This should not have been committed without also updating mongodb-odm because it breaks mongodb-odm. See doctrine/mongodb-odm#460.

@jmikola
jmikola Dec 17, 2012

ODM was updated to require a previous version of doctrine/mongodb. See doctrine/mongodb-odm@29c6b58

@Bilge
Bilge Dec 17, 2012

Oh, I see, but it's a logical fallacy to assume everyone uses composer.

- {
- return $this->getMongoCollection()->setSlaveOkay($ok);
- }
-
- public function getSlaveOkay()
- {
- return $this->getMongoCollection()->getSlaveOkay();
- }
-
public function validate($scanData = false)
{
return $this->getMongoCollection()->validate($scanData);
View
12 lib/Doctrine/MongoDB/Database.php
@@ -200,16 +200,6 @@ protected function doGetGridFs($name)
);
}
- public function setSlaveOkay($ok = true)
- {
- return $this->getMongoDB()->setSlaveOkay($ok);
- }
-
- public function getSlaveOkay()
- {
- return $this->getMongoDB()->getSlaveOkay();
- }
-
public function getProfilingLevel()
{
return $this->getMongoDB()->getProfilingLevel();
@@ -277,4 +267,4 @@ public function __toString()
{
return $this->name;
}
-}
+}
View
33 tests/Doctrine/MongoDB/Tests/CollectionTest.php
@@ -394,37 +394,6 @@ public function testSave()
$this->assertEquals(true, $result);
}
- public function testSetSlaveOkay()
- {
- $mockConnection = $this->getMockConnection();
- $mongoCollection = $this->getMockMongoCollection();
- $mongoCollection->expects($this->once())
- ->method('setSlaveOkay')
- ->with(true)
- ->will($this->returnValue(false));
-
- $mockDatabase = $this->getMockDatabase();
- $coll = $this->getTestCollection($mockConnection, $mongoCollection, $mockDatabase);
- $document = array();
- $result = $coll->setSlaveOkay(true);
- $this->assertEquals(false, $result);
- }
-
- public function testGetSlaveOkay()
- {
- $mockConnection = $this->getMockConnection();
- $mongoCollection = $this->getMockMongoCollection();
- $mongoCollection->expects($this->once())
- ->method('getSlaveOkay')
- ->will($this->returnValue(false));
-
- $mockDatabase = $this->getMockDatabase();
- $coll = $this->getTestCollection($mockConnection, $mongoCollection, $mockDatabase);
- $document = array();
- $result = $coll->getSlaveOkay();
- $this->assertEquals(false, $result);
- }
-
public function testValidate()
{
$mockConnection = $this->getMockConnection();
@@ -516,4 +485,4 @@ public function getMongoCollection()
{
return $this->mongoCollection;
}
-}
+}

0 comments on commit 681d51c

Please sign in to comment.