public function testEnsureUserActiveForResetPasswordFeature($ensureActive)
{
$expectError = $this->never();
if ($ensureActive) {
Configure::write('Users.Registration.ensureActive', true);
$expectError = $this->once();
}
$this->assertEquals('ae93ddbe32664ce7927cf0c5c5a5e59d', $this->table->get('00000000-0000-0000-0000-000000000001')->token);
$this->_mockRequestPost();
$this->_mockFlash();
$reference = 'user-1';
$this->Trait->request->expects($this->once())->method('data')->with('reference')->will($this->returnValue($reference));
$this->Trait->Flash->expects($expectError)->method('error')->with('The user is not active');
$this->Trait->requestResetPassword();
$this->assertNotEquals('xxx', $this->table->get('00000000-0000-0000-0000-000000000001')->token);
}