Issue #2597860 by neclimdul: UpdateRegistryTest tests missing assertions

8.0.x
Alex Pott 2015-10-25 18:21:00 -07:00
parent ff04d6a67d
commit 88f80206ec
1 changed files with 24 additions and 8 deletions

View File

@ -236,8 +236,12 @@ EOS;
public function testRegisterInvokedUpdatesWithoutExistingUpdates() { public function testRegisterInvokedUpdatesWithoutExistingUpdates() {
$this->setupBasicModules(); $this->setupBasicModules();
$key_value = $this->prophesize(KeyValueStoreInterface::class); $key_value = $this->prophesize(KeyValueStoreInterface::class);
$key_value->get('existing_updates', [])->willReturn([]); $key_value->get('existing_updates', [])
$key_value->set('existing_updates', ['module_a_post_update_a'])->willReturn(NULL); ->willReturn([])
->shouldBeCalledTimes(1);
$key_value->set('existing_updates', ['module_a_post_update_a'])
->willReturn(NULL)
->shouldBeCalledTimes(1);
$key_value = $key_value->reveal(); $key_value = $key_value->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [ $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
@ -253,8 +257,12 @@ EOS;
public function testRegisterInvokedUpdatesWithMultiple() { public function testRegisterInvokedUpdatesWithMultiple() {
$this->setupBasicModules(); $this->setupBasicModules();
$key_value = $this->prophesize(KeyValueStoreInterface::class); $key_value = $this->prophesize(KeyValueStoreInterface::class);
$key_value->get('existing_updates', [])->willReturn([]); $key_value->get('existing_updates', [])
$key_value->set('existing_updates', ['module_a_post_update_a', 'module_a_post_update_b'])->willReturn(NULL); ->willReturn([])
->shouldBeCalledTimes(1);
$key_value->set('existing_updates', ['module_a_post_update_a', 'module_a_post_update_b'])
->willReturn(NULL)
->shouldBeCalledTimes(1);
$key_value = $key_value->reveal(); $key_value = $key_value->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [ $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
@ -270,8 +278,12 @@ EOS;
public function testRegisterInvokedUpdatesWithExistingUpdates() { public function testRegisterInvokedUpdatesWithExistingUpdates() {
$this->setupBasicModules(); $this->setupBasicModules();
$key_value = $this->prophesize(KeyValueStoreInterface::class); $key_value = $this->prophesize(KeyValueStoreInterface::class);
$key_value->get('existing_updates', [])->willReturn(['module_a_post_update_b']); $key_value->get('existing_updates', [])
$key_value->set('existing_updates', ['module_a_post_update_b', 'module_a_post_update_a'])->willReturn(NULL); ->willReturn(['module_a_post_update_b'])
->shouldBeCalledTimes(1);
$key_value->set('existing_updates', ['module_a_post_update_b', 'module_a_post_update_a'])
->willReturn(NULL)
->shouldBeCalledTimes(1);
$key_value = $key_value->reveal(); $key_value = $key_value->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [ $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [
@ -287,8 +299,12 @@ EOS;
public function testFilterOutInvokedUpdatesByModule() { public function testFilterOutInvokedUpdatesByModule() {
$this->setupBasicModules(); $this->setupBasicModules();
$key_value = $this->prophesize(KeyValueStoreInterface::class); $key_value = $this->prophesize(KeyValueStoreInterface::class);
$key_value->get('existing_updates', [])->willReturn(['module_a_post_update_b', 'module_a_post_update_a', 'module_b_post_update_a']); $key_value->get('existing_updates', [])
$key_value->set('existing_updates', ['module_b_post_update_a'])->willReturn(NULL); ->willReturn(['module_a_post_update_b', 'module_a_post_update_a', 'module_b_post_update_a'])
->shouldBeCalledTimes(1);
$key_value->set('existing_updates', ['module_b_post_update_a'])
->willReturn(NULL)
->shouldBeCalledTimes(1);
$key_value = $key_value->reveal(); $key_value = $key_value->reveal();
$update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [ $update_registry = new UpdateRegistry('vfs://drupal', 'sites/default', [