Skip to content

Aspect Mock broken by comments #70

Open
@kolarski

Description

@kolarski

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions