Codeception / Codeception/AspectMock

Aspect Mock broken by comments

Aperta
#70 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
PHP
Stelle
784
Fork
132
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

Method declaration such as `function myMethod( ) /* {{{ */ {` cannot be mocked with Aspect Mock.

On line 98 current code gets the first open bracket { amd inserts the injection code after it
`$pos = strpos($dataArray[$i], '{');`

https://github.com/Codeception/AspectMock/blob/master/src/AspectMock/Intercept/BeforeMockTransformer.php#L98

This turns the method declaration to
`function myMethod( ) /* { if (($__am_res = __amock_before($this, __CLASS__, __FUNCTION__, array(), false)) !== __AM_CON
TINUE__) return $__am_res; {{ */ {
`

Which basically commented all Aspect Mock injection code.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.