diff --git a/core/modules/book/book.services.yml b/core/modules/book/book.services.yml index a2977f8..10b946b 100644 --- a/core/modules/book/book.services.yml +++ b/core/modules/book/book.services.yml @@ -6,7 +6,7 @@ services: - { name: breadcrumb_builder, priority: 701 } book.manager: class: Drupal\book\BookManager - arguments: ['@database', '@entity.manager', '@string_translation', '@config.factory', '@book.storage'] + arguments: ['@entity.manager', '@string_translation', '@config.factory', '@book.storage'] book.outline: class: Drupal\book\BookOutline arguments: ['@book.manager'] diff --git a/core/modules/book/src/BookManager.php b/core/modules/book/src/BookManager.php index 41f752f..36614bc 100644 --- a/core/modules/book/src/BookManager.php +++ b/core/modules/book/src/BookManager.php @@ -30,13 +30,6 @@ class BookManager implements BookManagerInterface { const BOOK_MAX_DEPTH = 9; /** - * Database Service Object. - * - * @var \Drupal\Core\Database\Connection - */ - protected $connection; - - /** * Entity manager Service Object. * * @var \Drupal\Core\Entity\EntityManagerInterface @@ -74,8 +67,7 @@ class BookManager implements BookManagerInterface { /** * Constructs a BookManager object. */ - public function __construct(Connection $connection, EntityManagerInterface $entity_manager, TranslationInterface $translation, ConfigFactoryInterface $config_factory, BookStorageInterface $book_storage) { - $this->connection = $connection; + public function __construct(EntityManagerInterface $entity_manager, TranslationInterface $translation, ConfigFactoryInterface $config_factory, BookStorageInterface $book_storage) { $this->entityManager = $entity_manager; $this->stringTranslation = $translation; $this->configFactory = $config_factory; diff --git a/core/modules/book/tests/src/BookManagerTest.php b/core/modules/book/tests/src/BookManagerTest.php index a7e0964..93e7e63 100644 --- a/core/modules/book/tests/src/BookManagerTest.php +++ b/core/modules/book/tests/src/BookManagerTest.php @@ -17,13 +17,6 @@ class BookManagerTest extends UnitTestCase { /** - * The mocked database connection. - * - * @var \Drupal\Core\Database\Connection|\PHPUnit_Framework_MockObject_MockObject - */ - protected $connection; - - /** * The mocked entity manager. * * @var \Drupal\Core\Entity\EntityManager|\PHPUnit_Framework_MockObject_MockObject @@ -62,14 +55,11 @@ class BookManagerTest extends UnitTestCase { * {@inheritdoc} */ protected function setUp() { - $this->connection = $this->getMockBuilder('Drupal\Core\Database\Connection') - ->disableOriginalConstructor() - ->getMock(); $this->entityManager = $this->getMock('Drupal\Core\Entity\EntityManagerInterface'); $this->translation = $this->getStringTranslationStub(); $this->configFactory = $this->getConfigFactoryStub(array()); $this->bookStorage = $this->getMock('Drupal\book\BookStorageInterface'); - $this->bookManager = new BookManager($this->connection, $this->entityManager, $this->translation, $this->configFactory, $this->bookStorage); + $this->bookManager = new BookManager($this->entityManager, $this->translation, $this->configFactory, $this->bookStorage); } /**