-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Amend login failure event being reported by mistake
- Loading branch information
1 parent
30bf5fd
commit b6cdc6b
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,6 +45,15 @@ public function testUserLoginSuccessEvent() | |
$this->assertEquals($name, $events[0]['metadata']['name']); | ||
} | ||
|
||
public function testHittingLoginPageDoesNotGenerateUserEvent() | ||
{ | ||
$spec = GetSpec::create('request', '/wp-login.php'); | ||
$this->call($spec, [CURLOPT_FOLLOWLOCATION => true, CURLOPT_COOKIESESSION => true]); | ||
|
||
$events = AppsecStatus::getInstance()->getEvents(['track_user_login_failure_event_automated']); | ||
$this->assertEquals(0, count($events)); | ||
} | ||
|
||
public function testUserLoginFailureEventWhenUserDoesNotExists() | ||
{ | ||
$email = '[email protected]'; | ||
|
18 changes: 18 additions & 0 deletions
18
tests/Integrations/WordPress/V6_1/AutomatedLoginEventsTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace DDTrace\Tests\Integrations\WordPress\V6_1; | ||
|
||
use DDTrace\Tests\Integrations\WordPress\AutomatedLoginEventsTestSuite; | ||
|
||
/** | ||
* @group appsec | ||
*/ | ||
class AutomatedLoginEventsTest extends AutomatedLoginEventsTestSuite | ||
{ | ||
public static $database = "wp61"; | ||
|
||
public static function getAppIndexScript() | ||
{ | ||
return __DIR__ . '/../../../Frameworks/WordPress/Version_6_1/index.php'; | ||
} | ||
} |