|
13 | 13 |
|
14 | 14 | use FOS\ElasticaBundle\Message\AsyncPersistPage; |
15 | 15 | use FOS\ElasticaBundle\Persister\AsyncPagerPersister; |
16 | | -use FOS\ElasticaBundle\Persister\InPlacePagerPersister; |
17 | | -use FOS\ElasticaBundle\Persister\ObjectPersisterInterface; |
18 | 16 | use FOS\ElasticaBundle\Persister\PagerPersisterInterface; |
19 | 17 | use FOS\ElasticaBundle\Persister\PagerPersisterRegistry; |
20 | | -use FOS\ElasticaBundle\Persister\PersisterRegistry; |
21 | 18 | use FOS\ElasticaBundle\Provider\PagerInterface; |
22 | | -use FOS\ElasticaBundle\Provider\PagerProviderInterface; |
23 | 19 | use FOS\ElasticaBundle\Provider\PagerProviderRegistry; |
24 | 20 | use PHPUnit\Framework\TestCase; |
25 | 21 | use Symfony\Component\DependencyInjection\ServiceLocator; |
26 | | -use Symfony\Component\EventDispatcher\EventDispatcherInterface; |
27 | 22 | use Symfony\Component\Messenger\Envelope; |
28 | 23 | use Symfony\Component\Messenger\MessageBusInterface; |
29 | 24 |
|
@@ -56,46 +51,4 @@ function ($message) { |
56 | 51 | $pager = $this->createMock(PagerInterface::class); |
57 | 52 | $sut->insert($pager); |
58 | 53 | } |
59 | | - |
60 | | - public function testInsertPageReturnObjectCount() |
61 | | - { |
62 | | - $persistersLocator = $this->createMock(ServiceLocator::class); |
63 | | - $persistersLocator->expects($this->once())->method('has')->with('foo')->willReturn(true); |
64 | | - $persistersLocator->expects($this->once())->method('get')->with('foo')->willReturn($this->createMock(ObjectPersisterInterface::class)); |
65 | | - |
66 | | - $pagerPersistersLocator = $this->createMock(ServiceLocator::class); |
67 | | - $pagerPersistersLocator->expects($this->once())->method('has')->with('in_place')->willReturn(true); |
68 | | - $pagerPersistersLocator->expects($this->once())->method('get')->with('in_place')->willReturn( |
69 | | - new InPlacePagerPersister( |
70 | | - new PersisterRegistry($persistersLocator), |
71 | | - $this->createMock(EventDispatcherInterface::class) |
72 | | - ) |
73 | | - ); |
74 | | - |
75 | | - $pagerPersisterRegistry = new PagerPersisterRegistry($pagerPersistersLocator); |
76 | | - |
77 | | - $pagerMock = $this->createMock(PagerInterface::class); |
78 | | - $pagerMock->expects($this->exactly(2))->method('setMaxPerPage')->with(10); |
79 | | - $pagerMock->method('setCurrentPage')->withConsecutive([1], [1], [0]); |
80 | | - $pagerMock->expects($this->exactly(2))->method('getCurrentPageResults')->willReturn([]); |
81 | | - |
82 | | - $provider = $this->createMock(PagerProviderInterface::class); |
83 | | - $provider->expects($this->once())->method('provide')->with([ |
84 | | - 'first_page' => 1, |
85 | | - 'last_page' => 1, |
86 | | - 'indexName' => 'foo', |
87 | | - 'max_per_page' => 10, |
88 | | - ])->willReturn($pagerMock); |
89 | | - |
90 | | - $pagerProviderRegistry = $this->createMock(PagerProviderRegistry::class); |
91 | | - $pagerProviderRegistry->expects($this->once())->method('getProvider')->with('foo')->willReturn($provider); |
92 | | - |
93 | | - $messageBus = $this->createMock(MessageBusInterface::class); |
94 | | - $sut = new AsyncPagerPersister($pagerPersisterRegistry, $pagerProviderRegistry, $messageBus); |
95 | | - |
96 | | - $sut->insertPage(1, [ |
97 | | - 'indexName' => 'foo', |
98 | | - 'max_per_page' => 10, |
99 | | - ]); |
100 | | - } |
101 | 54 | } |
0 commit comments