diff --git a/composer.lock b/composer.lock index 2997782..0d87532 100644 --- a/composer.lock +++ b/composer.lock @@ -3842,16 +3842,16 @@ }, { "name": "laminas/laminas-permissions-acl", - "version": "2.7.1", + "version": "2.7.2", "source": { "type": "git", "url": "https://github.com/laminas/laminas-permissions-acl.git", - "reference": "624567fe376a70e0bfb5aa8217d5afa13b9d6e61" + "reference": "d8cd35ed94eef5d3d2533af4a72cf1c2932084bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laminas/laminas-permissions-acl/zipball/624567fe376a70e0bfb5aa8217d5afa13b9d6e61", - "reference": "624567fe376a70e0bfb5aa8217d5afa13b9d6e61", + "url": "https://api.github.com/repos/laminas/laminas-permissions-acl/zipball/d8cd35ed94eef5d3d2533af4a72cf1c2932084bb", + "reference": "d8cd35ed94eef5d3d2533af4a72cf1c2932084bb", "shasum": "" }, "require": { @@ -3859,7 +3859,7 @@ "php": "^5.6 || ^7.0" }, "replace": { - "zendframework/zend-permissions-acl": "self.version" + "zendframework/zend-permissions-acl": "^2.7.1" }, "require-dev": { "laminas/laminas-coding-standard": "~1.0.0", @@ -3870,12 +3870,6 @@ "laminas/laminas-servicemanager": "To support Laminas\\Permissions\\Acl\\Assertion\\AssertionManager plugin manager usage" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.7.x-dev", - "dev-develop": "2.8.x-dev" - } - }, "autoload": { "psr-4": { "Laminas\\Permissions\\Acl\\": "src/" @@ -3891,7 +3885,13 @@ "acl", "laminas" ], - "time": "2019-12-31T17:37:23+00:00" + "funding": [ + { + "url": "https://funding.communitybridge.org/projects/laminas-project", + "type": "community_bridge" + } + ], + "time": "2020-09-22T14:08:17+00:00" }, { "name": "laminas/laminas-progressbar", @@ -4793,16 +4793,16 @@ }, { "name": "nikic/php-parser", - "version": "v4.9.1", + "version": "v4.10.0", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "88e519766fc58bd46b8265561fb79b54e2e00b28" + "reference": "1c13d05035deff45f1230ca68bd7d74d621762d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/88e519766fc58bd46b8265561fb79b54e2e00b28", - "reference": "88e519766fc58bd46b8265561fb79b54e2e00b28", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/1c13d05035deff45f1230ca68bd7d74d621762d9", + "reference": "1c13d05035deff45f1230ca68bd7d74d621762d9", "shasum": "" }, "require": { @@ -4841,7 +4841,7 @@ "parser", "php" ], - "time": "2020-08-30T16:15:20+00:00" + "time": "2020-09-19T14:52:48+00:00" }, { "name": "paragonie/random_compat", @@ -7653,16 +7653,16 @@ }, { "name": "phpdocumentor/reflection-docblock", - "version": "5.2.1", + "version": "5.2.2", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44" + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/d870572532cd70bc3fab58f2e23ad423c8404c44", - "reference": "d870572532cd70bc3fab58f2e23ad423c8404c44", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/069a785b2141f5bcf49f3e353548dc1cce6df556", + "reference": "069a785b2141f5bcf49f3e353548dc1cce6df556", "shasum": "" }, "require": { @@ -7701,20 +7701,20 @@ } ], "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "time": "2020-08-15T11:14:08+00:00" + "time": "2020-09-03T19:13:55+00:00" }, { "name": "phpdocumentor/type-resolver", - "version": "1.3.0", + "version": "1.4.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651" + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651", - "reference": "e878a14a65245fbe78f8080eba03b47c3b705651", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", + "reference": "6a467b8989322d92aa1c8bf2bebcc6e5c2ba55c0", "shasum": "" }, "require": { @@ -7746,7 +7746,7 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-06-27T10:12:23+00:00" + "time": "2020-09-17T18:55:26+00:00" }, { "name": "phpspec/prophecy", @@ -8061,6 +8061,7 @@ "keywords": [ "tokenizer" ], + "abandoned": true, "time": "2019-09-17T06:23:10+00:00" }, { diff --git a/src/Listener/JobEventSubscriber.php b/src/Listener/JobEventSubscriber.php index c6db940..fec34e0 100644 --- a/src/Listener/JobEventSubscriber.php +++ b/src/Listener/JobEventSubscriber.php @@ -186,10 +186,9 @@ public function postFlush(PostFlushEventArgs $eventArgs) $client->deleteByIds($this->entityToDocumentFilter->getDocumentIds($job)); } - // commit to index & optimize it + // commit to index $client = $this->getSolrClient(); $client->commit(true, false); - $client->optimize(1, true, false); // clear arrays. There could be multiple flushs per requests and we do not want // to process already processed entities. diff --git a/test/SolrTest/Listener/JobEventSubscriberTest.php b/test/SolrTest/Listener/JobEventSubscriberTest.php index 28bde3d..fa3d661 100644 --- a/test/SolrTest/Listener/JobEventSubscriberTest.php +++ b/test/SolrTest/Listener/JobEventSubscriberTest.php @@ -94,11 +94,11 @@ protected function setUp(): void ->getMock(); $options->method('getJobsPath') ->willReturn('/some/path'); - + $this->client = $this->getMockBuilder(\SolrClient::class) ->disableOriginalConstructor() ->getMock(); - + $this->manager = $this->getMockBuilder(Manager::class) ->disableOriginalConstructor() ->getMock(); @@ -106,7 +106,7 @@ protected function setUp(): void ->willReturn($this->client); $this->manager->method('getOptions') ->willReturn($options); - + $this->entityToDocumentFilter = $this->getMockBuilder(EntityToDocumentFilter::class) ->disableOriginalConstructor() ->getMock(); @@ -137,17 +137,17 @@ public function testPrePersistShouldNotProcessNonJobDocument() ->getMock(); $job->expects($this->never()) ->method('isActive'); - + $event = $this->getMockBuilder(PreUpdateEventArgs::class) ->disableOriginalConstructor() ->getMock(); $event->expects($this->once()) ->method('getDocument') ->willReturn($job); - + $this->subscriber->prePersist($event); } - + /** * @param string $status * @param bool $shouldBeAdded @@ -187,7 +187,7 @@ public function testPreUpdateShouldNotProcessNonJobDocument() ->method('getDocument'); $event->expects($this->never()) ->method('hasChangedField'); - + $this->subscriber->preUpdate($event); } @@ -241,7 +241,7 @@ public function testPreUpdateWithChangedStatus($status, $shouldBeAdded, $shouldB $subscriber = $this->subscriber; $subscriber->preUpdate($event); - + if ($shouldBeAdded) { $this->assertContains($job, $subscriber->getAdd()); } else { @@ -254,7 +254,7 @@ public function testPreUpdateWithChangedStatus($status, $shouldBeAdded, $shouldB $this->assertNotContains($job, $subscriber->getDelete()); } } - + /** * @covers ::postFlush() */ @@ -266,14 +266,14 @@ public function testPostFlushWithNoJobsToProcess() ->getMock(); $subscriber->expects($this->never()) ->method('getSolrClient'); - + $event = $this->getMockBuilder(PostFlushEventArgs::class) ->disableOriginalConstructor() ->getMock(); - + $subscriber->postFlush($event); } - + /** * @param string $status * @param bool $shouldBeAdded @@ -296,47 +296,45 @@ public function testPostFlushWithJobsToProcess($status, $shouldBeAdded, $shouldB ->method('hasChangedField') ->with($this->equalTo('status')) ->willReturn(true); - + $this->subscriber->preUpdate($event); - + if ($shouldBeAdded) { $document = new SolrInputDocument(); $this->entityToDocumentFilter->expects($this->once()) ->method('filter') ->with($this->identicalTo($job)) ->willReturn($document); - + $this->client->expects($this->once()) ->method('addDocument') ->with($this->identicalTo($document)); } - + if ($shouldBeDeleted) { $ids = [1, 2, 3]; $this->entityToDocumentFilter->expects($this->once()) ->method('getDocumentIds') ->with($this->identicalTo($job)) ->willReturn($ids); - + $this->client->expects($this->once()) ->method('deleteByIds') ->with($this->identicalTo($ids)); } - + if ($shouldBeAdded || $shouldBeDeleted) { $this->client->expects($this->once()) ->method('commit'); - $this->client->expects($this->once()) - ->method('optimize'); } - + $event = $this->getMockBuilder(PostFlushEventArgs::class) ->disableOriginalConstructor() ->getMock(); - + $this->subscriber->postFlush($event); } - + /** * @covers ::factory() */ @@ -350,10 +348,10 @@ public function testFactory() ->withConsecutive([$this->equalTo('Solr/Options/Module')], [$this->equalTo('Solr/Manager')]) ->will($this->onConsecutiveCalls($options,$this->manager)); - + $this->assertInstanceOf(JobEventSubscriber::class, JobEventSubscriber::factory($container)); } - + /** * @return array */