9
9
use Drupal \Core \Database \Schema ;
10
10
use Drupal \Core \Database \StatementWrapper ;
11
11
use Drupal \common \Storage \JobStore ;
12
- use Drupal \datastore \Plugin \QueueWorker \FileFetcherJob ;
13
12
14
13
use Contracts \Mock \Storage \Memory ;
14
+ use FileFetcher \FileFetcher ;
15
15
use MockChain \Chain ;
16
16
use MockChain \Sequence ;
17
17
use PHPUnit \Framework \TestCase ;
@@ -30,7 +30,7 @@ public function testConstruction() {
30
30
->add (Connection::class, "schema " , Schema::class)
31
31
->add (Schema::class, "tableExists " , FALSE );
32
32
33
- $ jobStore = new JobStore (FileFetcherJob ::class, $ chain ->getMock ());
33
+ $ jobStore = new JobStore (FileFetcher ::class, $ chain ->getMock ());
34
34
$ this ->assertTrue (is_object ($ jobStore ));
35
35
}
36
36
@@ -59,8 +59,8 @@ public function testRetrieve() {
59
59
->add (Connection::class, 'query ' , StatementWrapper::class)
60
60
->add (StatementWrapper::class, 'fetchAll ' , $ fieldInfo );
61
61
62
- $ jobStore = new JobStore (FileFetcherJob ::class, $ chain ->getMock ());
63
- $ this ->assertEquals ($ job_data , $ jobStore ->retrieve ("1 " , FileFetcherJob ::class));
62
+ $ jobStore = new JobStore (FileFetcher ::class, $ chain ->getMock ());
63
+ $ this ->assertEquals ($ job_data , $ jobStore ->retrieve ("1 " , FileFetcher ::class));
64
64
}
65
65
66
66
/**
@@ -90,7 +90,7 @@ public function testRetrieveAll() {
90
90
->add (Connection::class, 'query ' , StatementWrapper::class)
91
91
->add (StatementWrapper::class, 'fetchAll ' , $ sequence );
92
92
93
- $ jobStore = new JobStore (FileFetcherJob ::class, $ chain ->getMock ());
93
+ $ jobStore = new JobStore (FileFetcher ::class, $ chain ->getMock ());
94
94
$ this ->assertTrue (is_array ($ jobStore ->retrieveAll ()));
95
95
}
96
96
@@ -127,7 +127,7 @@ public function testStore() {
127
127
->add (StatementWrapper::class, 'fetchAll ' , $ fieldInfo )
128
128
->getMock ();
129
129
130
- $ jobStore = new JobStore (FileFetcherJob ::class, $ connection );
130
+ $ jobStore = new JobStore (FileFetcher ::class, $ connection );
131
131
132
132
$ this ->assertEquals ("1 " , $ jobStore ->store (json_encode ($ jobObject ), "1 " ));
133
133
}
@@ -151,16 +151,16 @@ public function testRemove() {
151
151
->add (StatementWrapper::class, 'fetchAll ' , $ fieldInfo )
152
152
->getMock ();
153
153
154
- $ jobStore = new JobStore (FileFetcherJob ::class, $ connection );
154
+ $ jobStore = new JobStore (FileFetcher ::class, $ connection );
155
155
156
- $ this ->assertEquals ("" , $ jobStore ->remove ("1 " , FileFetcherJob ::class));
156
+ $ this ->assertEquals ("" , $ jobStore ->remove ("1 " , FileFetcher ::class));
157
157
}
158
158
159
159
/**
160
160
* Private.
161
161
*/
162
162
private function getFileFetcher () {
163
- return FileFetcherJob ::get ("1 " , new Memory (), ["filePath " => "file:// " . __DIR__ . "/../../data/countries.csv " ]);
163
+ return FileFetcher ::get ("1 " , new Memory (), ["filePath " => "file:// " . __DIR__ . "/../../data/countries.csv " ]);
164
164
}
165
165
166
166
}
0 commit comments