@@ 348-364 (lines=17) @@ | ||
345 | /** |
|
346 | * Test attach_stored_licenses_on_connection() for the master user. |
|
347 | */ |
|
348 | public function test_attach_stored_licenses_on_connection__master_user() { |
|
349 | $connection = $this->createMock( Connection_Manager::class ); |
|
350 | ||
351 | $connection->method( 'is_connection_owner' )->willReturn( true ); |
|
352 | ||
353 | $licensing = $this->createPartialMock( |
|
354 | Licensing::class, |
|
355 | array( 'connection', 'attach_stored_licenses' ) |
|
356 | ); |
|
357 | ||
358 | $licensing->method( 'connection' )->willReturn( $connection ); |
|
359 | ||
360 | $licensing->expects( $this->once() ) |
|
361 | ->method( 'attach_stored_licenses' ); |
|
362 | ||
363 | $licensing->attach_stored_licenses_on_connection(); |
|
364 | } |
|
365 | ||
366 | /** |
|
367 | * Test attach_stored_licenses_on_connection() for a secondary user. |
|
@@ 369-385 (lines=17) @@ | ||
366 | /** |
|
367 | * Test attach_stored_licenses_on_connection() for a secondary user. |
|
368 | */ |
|
369 | public function test_attach_stored_licenses_on_connection__secondary_user() { |
|
370 | $connection = $this->createMock( Connection_Manager::class ); |
|
371 | ||
372 | $connection->method( 'is_connection_owner' )->willReturn( false ); |
|
373 | ||
374 | $licensing = $this->createPartialMock( |
|
375 | Licensing::class, |
|
376 | array( 'connection', 'attach_stored_licenses' ) |
|
377 | ); |
|
378 | ||
379 | $licensing->method( 'connection' )->willReturn( $connection ); |
|
380 | ||
381 | $licensing->expects( $this->never() ) |
|
382 | ->method( 'attach_stored_licenses' ); |
|
383 | ||
384 | $licensing->attach_stored_licenses_on_connection(); |
|
385 | } |
|
386 | } |
|
387 |