Skip to content

Commit f3f97a5

Browse files
Mile23paul-m
authored andcommitted
Issue #2986443 by Mile23: Put MockSessionTrait in the tests namespace
1 parent 390a1e5 commit f3f97a5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

stream_wrapper_example/tests/src/Kernel/StreamWrapperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
use Drupal\Component\Utility\Html;
66
use Drupal\KernelTests\KernelTestBase;
7-
use Drupal\stream_wrapper_example\StreamWrapper\MockSessionTrait;
7+
use Drupal\Tests\stream_wrapper_example\Traits\MockSessionTrait;
88

99
/**
1010
* Test of the Session Stream Wrapper Class.

stream_wrapper_example/src/StreamWrapper/MockSessionTrait.php renamed to stream_wrapper_example/tests/src/Traits/MockSessionTrait.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
22

3-
namespace Drupal\stream_wrapper_example\StreamWrapper;
3+
namespace Drupal\Tests\stream_wrapper_example\Traits;
44

5+
use Drupal\stream_wrapper_example\StreamWrapper\SessionWrapper;
56
use Symfony\Component\HttpFoundation\RequestStack;
67
use Symfony\Component\HttpFoundation\Request;
78
use Symfony\Component\HttpFoundation\Session\SessionInterface;
@@ -29,7 +30,7 @@ trait MockSessionTrait {
2930
/**
3031
* Create a mock session object.
3132
*
32-
* @return ProphecyInterface
33+
* @return \Symfony\Component\HttpFoundation\RequestStack|\Prophecy\Prophecy\ProphecyInterface
3334
* A test double, or mock, of a RequestStack object
3435
* that can be used to return a mock Session object.
3536
*/

stream_wrapper_example/tests/src/Unit/SessionWrapperTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace Drupal\Tests\stream_wrapper_example\Unit;
44

5-
use Drupal\Tests\UnitTestCase;
65
use Drupal\stream_wrapper_example\StreamWrapper\SessionWrapper;
7-
use Drupal\stream_wrapper_example\StreamWrapper\MockSessionTrait;
6+
use Drupal\Tests\stream_wrapper_example\Traits\MockSessionTrait;
7+
use Drupal\Tests\UnitTestCase;
88

99
/**
1010
* PHPUnit test for the SessionWrapper session manipulation class.

0 commit comments

Comments
 (0)