Skip to content

Commit

Permalink
test(integrations): update event names
Browse files Browse the repository at this point in the history
Signed-off-by: Alexandre Rulleau <[email protected]>
  • Loading branch information
Leiyks committed Jan 16, 2025
1 parent 2cbb21a commit bdf213e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
12 changes: 6 additions & 6 deletions tests/Integrations/Laravel/AutomatedLoginEventsTestSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function testUserLoginSuccessEvent()

$this->login($email);

$events = AppsecStatus::getInstance()->getEvents(['track_user_login_success_event']);
$events = AppsecStatus::getInstance()->getEvents(['track_user_login_success_event_automated']);
$this->assertEquals(1, count($events));
$this->assertEquals($id, $events[0]['userId']);
$this->assertEquals($email, $events[0]['userLogin']);
Expand All @@ -58,7 +58,7 @@ public function testUserLoginFailureEvent()

$this->login($email);

$events = AppsecStatus::getInstance()->getEvents(['track_user_login_failure_event']);
$events = AppsecStatus::getInstance()->getEvents(['track_user_login_failure_event_automated']);
$this->assertEquals(1, count($events));
$this->assertEquals($email, $events[0]['userLogin']);
}
Expand All @@ -77,7 +77,7 @@ public function testUserSignUp()

$this->assertEquals(1, count($users));

$signUpEvent = AppsecStatus::getInstance()->getEvents(['track_user_signup_event']);
$signUpEvent = AppsecStatus::getInstance()->getEvents(['track_user_signup_event_automated']);

$this->assertEquals($users[0]['id'], $signUpEvent[0]['userId']);
$this->assertEquals($users[0]['email'], $signUpEvent[0]['userLogin']);
Expand All @@ -99,9 +99,9 @@ public function testLoggedInCalls()
$this->call(GetSpec::create('Behind auth', '/behind_auth'));

$events = AppsecStatus::getInstance()->getEvents([
'track_user_login_success_event',
'track_user_login_failure_event',
'track_user_signup_event'
'track_user_login_success_event_automated',
'track_user_login_failure_event_automated',
'track_user_signup_event_automated'
]);
$this->assertEquals(0, count($events)); //Auth does not generate appsec events
$this->disableSession();
Expand Down
6 changes: 3 additions & 3 deletions tests/Integrations/Symfony/AutomatedLoginEventsTestSuite.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function testUserLoginSuccessEvent()

$this->call($spec, [ CURLOPT_FOLLOWLOCATION => false ]);

$events = AppsecStatus::getInstance()->getEvents(['track_user_login_success_event']);
$events = AppsecStatus::getInstance()->getEvents(['track_user_login_success_event_automated']);

$this->assertEquals(1, count($events));
$this->assertEquals($email, $events[0]['userLogin']);
Expand All @@ -59,7 +59,7 @@ public function testUserLoginFailureEvent()

$this->call($spec, [ CURLOPT_FOLLOWLOCATION => false ]);

$events = AppsecStatus::getInstance()->getEvents(['track_user_login_failure_event']);
$events = AppsecStatus::getInstance()->getEvents(['track_user_login_failure_event_automated']);
$this->assertEquals(1, count($events));
$this->assertEmpty($events[0]['userLogin']);
$this->assertEmpty($events[0]['userId']);
Expand All @@ -84,7 +84,7 @@ public function testUserSignUp()

$this->assertEquals(1, count($users));

$signUpEvent = AppsecStatus::getInstance()->getEvents(['track_user_signup_event']);
$signUpEvent = AppsecStatus::getInstance()->getEvents(['track_user_signup_event_automated']);

$this->assertEquals($email, $signUpEvent[0]['userLogin']);
$this->assertEquals($email, $signUpEvent[0]['userId']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testUserLoginSuccessEvent()

$this->call($spec, [CURLOPT_FOLLOWLOCATION => false, CURLOPT_COOKIESESSION => true]);

$events = AppsecStatus::getInstance()->getEvents(['track_user_login_success_event']);
$events = AppsecStatus::getInstance()->getEvents(['track_user_login_success_event_automated']);
$this->assertEquals(1, count($events));
$this->assertEquals($email, $events[0]['userLogin']);
$this->assertEquals($id, $events[0]['userId']);
Expand All @@ -55,7 +55,7 @@ public function testUserLoginFailureEventWhenUserDoesNotExists()

$this->call($spec, [CURLOPT_FOLLOWLOCATION => false, CURLOPT_COOKIESESSION => true]);

$events = AppsecStatus::getInstance()->getEvents(['track_user_login_failure_event']);
$events = AppsecStatus::getInstance()->getEvents(['track_user_login_failure_event_automated']);
$this->assertEquals(1, count($events));
$this->assertEquals($email, $events[0]['userId']);
$this->assertEquals($email, $events[0]['userLogin']);
Expand All @@ -80,7 +80,7 @@ public function testUserLoginFailureEventWhenUserDoesExists()

$this->call($spec, [CURLOPT_FOLLOWLOCATION => false, CURLOPT_COOKIESESSION => true]);

$events = AppsecStatus::getInstance()->getEvents(['track_user_login_failure_event']);
$events = AppsecStatus::getInstance()->getEvents(['track_user_login_failure_event_automated']);
$this->assertEquals(1, count($events));
$this->assertEquals($email, $events[0]['userId']);
$this->assertEquals($email, $events[0]['userLogin']);
Expand All @@ -103,7 +103,7 @@ public function testUserSignUp()

$this->assertEquals(1, count($users));

$signUpEvent = AppsecStatus::getInstance()->getEvents(['track_user_signup_event']);
$signUpEvent = AppsecStatus::getInstance()->getEvents(['track_user_signup_event_automated']);

$this->assertEquals($users[0]['ID'], $signUpEvent[0]['userId']);
$this->assertEquals($users[0]['user_login'], $signUpEvent[0]['userLogin']);
Expand Down

0 comments on commit bdf213e

Please sign in to comment.