Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 148 Revision 621
Zeile 125... Zeile 125...
125
    }
125
    }
Zeile 126... Zeile 126...
126
 
126
 
127
    /**
127
    /**
128
     * Assert if a job was pushed a number of times.
128
     * Assert if a job was pushed a number of times.
129
     *
129
     *
130
     * @param  string  $command
130
     * @param  string|\Closure  $command
131
     * @param  int  $times
131
     * @param  int  $times
132
     * @return void
132
     * @return void
133
     */
133
     */
134
    public function assertDispatchedTimes($command, $times = 1)
134
    public function assertDispatchedTimes($command, $times = 1)
-
 
135
    {
-
 
136
        $callback = null;
-
 
137
 
-
 
138
        if ($command instanceof Closure) {
-
 
139
            [$command, $callback] = [$this->firstClosureParameterType($command), $command];
-
 
140
        }
135
    {
141
 
136
        $count = $this->dispatched($command)->count() +
142
        $count = $this->dispatched($command, $callback)->count() +
137
                 $this->dispatchedAfterResponse($command)->count() +
143
                 $this->dispatchedAfterResponse($command, $callback)->count() +
Zeile 138... Zeile 144...
138
                 $this->dispatchedSync($command)->count();
144
                 $this->dispatchedSync($command, $callback)->count();
139
 
145
 
140
        PHPUnit::assertSame(
146
        PHPUnit::assertSame(
141
            $times, $count,
147
            $times, $count,
Zeile 198... Zeile 204...
198
    }
204
    }
Zeile 199... Zeile 205...
199
 
205
 
200
    /**
206
    /**
201
     * Assert if a job was pushed synchronously a number of times.
207
     * Assert if a job was pushed synchronously a number of times.
202
     *
208
     *
203
     * @param  string  $command
209
     * @param  string|\Closure  $command
204
     * @param  int  $times
210
     * @param  int  $times
205
     * @return void
211
     * @return void
206
     */
212
     */
207
    public function assertDispatchedSyncTimes($command, $times = 1)
213
    public function assertDispatchedSyncTimes($command, $times = 1)
-
 
214
    {
-
 
215
        $callback = null;
-
 
216
 
-
 
217
        if ($command instanceof Closure) {
-
 
218
            [$command, $callback] = [$this->firstClosureParameterType($command), $command];
-
 
219
        }
208
    {
220
 
Zeile 209... Zeile 221...
209
        $count = $this->dispatchedSync($command)->count();
221
        $count = $this->dispatchedSync($command, $callback)->count();
210
 
222
 
211
        PHPUnit::assertSame(
223
        PHPUnit::assertSame(
212
            $times, $count,
224
            $times, $count,
Zeile 257... Zeile 269...
257
    }
269
    }
Zeile 258... Zeile 270...
258
 
270
 
259
    /**
271
    /**
260
     * Assert if a job was pushed after the response was sent a number of times.
272
     * Assert if a job was pushed after the response was sent a number of times.
261
     *
273
     *
262
     * @param  string  $command
274
     * @param  string|\Closure  $command
263
     * @param  int  $times
275
     * @param  int  $times
264
     * @return void
276
     * @return void
265
     */
277
     */
266
    public function assertDispatchedAfterResponseTimes($command, $times = 1)
278
    public function assertDispatchedAfterResponseTimes($command, $times = 1)
-
 
279
    {
-
 
280
        $callback = null;
-
 
281
 
-
 
282
        if ($command instanceof Closure) {
-
 
283
            [$command, $callback] = [$this->firstClosureParameterType($command), $command];
-
 
284
        }
267
    {
285
 
Zeile 268... Zeile 286...
268
        $count = $this->dispatchedAfterResponse($command)->count();
286
        $count = $this->dispatchedAfterResponse($command, $callback)->count();
269
 
287
 
270
        PHPUnit::assertSame(
288
        PHPUnit::assertSame(
271
            $times, $count,
289
            $times, $count,