UseMuffin/Footprint

Using Footprint in Unit Testing

Closed this issue · 1 comments

Seems like the Footprint doesn't work when unit testing. The _footprint is not attached to the $options array in the beforeSave().

I am also aware of issue 21, so I have manually logged the user like:

   public function setUp()
    {
        parent::setUp();

        $this->session([
            'Auth' => [
                'User' => [
                    'id' => 'xxx',
                    'company_id' => 'xxx',
                    'Roles' => [
                        'company' => [
                            'name' => 'xxx',
                            'identifier' => 'xxx'
                        ],
                    ]
                ],
            ],
        ]);
    }

The above didn't help. Any suggestions ?

Found the problem. Had to explicitly call $this->listener = new FootprintListener(); after mocking the session.