[PhpUnitBridge] Mock DNS functions#18181
Conversation
nicolas-grekas
commented
Mar 15, 2016
| Q | A |
|---|---|
| Branch | master |
| Bug fix? | no |
| New feature? | yes |
| BC breaks? | no |
| Deprecations? | no |
| Tests pass? | yes |
| Fixed tickets | #16819 |
| License | MIT |
| Doc PR | - |
715a003 to
5abd11d
Compare
|
Thanks for this, @nicolas-grekas ! |
| { | ||
| return isset(self::$resolutions[$type][$host]) | ||
| ? self::$resolutions[$type][$host] | ||
| : \checkdnsrr($host, $type); |
5abd11d to
ddefaa3
Compare
9f5b856 to
d21746c
Compare
|
This PR now has mocks for all DNS functions, and unit tests. |
d21746c to
391d2c8
Compare
| "Symfony\\Bridge\\Monolog\\": "src/Symfony/Bridge/Monolog/", | ||
| "Symfony\\Bridge\\ProxyManager\\": "src/Symfony/Bridge/ProxyManager/", | ||
| "Symfony\\Bridge\\Twig\\": "src/Symfony/Bridge/Twig/", | ||
| "Symfony\\Bridge\\": "src/Symfony/Bridge/", |
There was a problem hiding this comment.
What was the reason we didn't have this before?
0a79ba1 to
7a8b925
Compare
|
|
||
| use Symfony\Bridge\PhpUnit\DnsMock; | ||
|
|
||
| require_once __DIR__.'/../DnsMock.php'; |
There was a problem hiding this comment.
this is temporary until our phpunit wrapper is updated (PR coming on 2.3 after merge)
84455f4 to
1a8bb65
Compare
| private $isSkipped = array(); | ||
|
|
||
| public function __construct(array $extraClockMockedNamespaces = array()) | ||
| public function __construct(array $extraClockMockedNamespaces = array(), array $extraDnsMockedNamespaces = array()) |
There was a problem hiding this comment.
That does not scale well. I think we need to think about another way to inject those mocked configs.
98e58fa to
4619210
Compare
| private $isSkipped = array(); | ||
|
|
||
| public function __construct(array $extraClockMockedNamespaces = array()) | ||
| public function __construct(array $mockedNamespaces = array()) |
There was a problem hiding this comment.
I think we should now document which keys (groups) are supported by the listener.
There was a problem hiding this comment.
documented, ok for you ?
4619210 to
0b31285
Compare
|
Thank you @nicolas-grekas. |
This PR was merged into the 3.1-dev branch. Discussion ---------- [PhpUnitBridge] Mock DNS functions | Q | A | ------------- | --- | Branch | master | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #16819 | License | MIT | Doc PR | - Commits ------- 0b31285 [PhpUnitBridge] Mock DNS functions
| } else { | ||
| self::$globallyEnabled = true; | ||
| if ($warn) { | ||
| echo "Clock-mocked namespaces for SymfonyTestsListener need to be nested in a \"time-sensitive\" key. This will be enforced in Symfony 4.0.\n"; |
There was a problem hiding this comment.
writing this to stderr would be better than in stdout
There was a problem hiding this comment.
but did not work when I tried so I resorted to stdout, which is where phpunit and this listener echo in other cases...
This PR was merged into the 3.2 branch. Discussion ---------- [PhpUnitBridge] add a changelog file | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #18181 | License | MIT | Doc PR | Commits ------- e5455db [PhpUnitBridge] add a changelog file