-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add link to delete all run from the main paginated list page #239
Conversation
src/Xhgui/Controller/Run.php
Outdated
@@ -124,6 +124,21 @@ public function delete() | |||
$this->app->redirect($redirect); | |||
} | |||
|
|||
public function delete_all() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name "Xhgui_Controller_Run::delete_all" is not in camel caps format
src/Xhgui/Controller/Run.php
Outdated
@@ -124,6 +124,21 @@ public function delete() | |||
$this->app->redirect($redirect); | |||
} | |||
|
|||
public function delete_all() | |||
{ | |||
$request = $this->app->request(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected at least 8 spaces, found 6
src/Xhgui/Controller/Run.php
Outdated
$request = $this->app->request(); | ||
|
||
// Delete all profile runs. | ||
$delete = $this->profiles->truncate(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected at least 8 spaces, found 6
src/Xhgui/Controller/Run.php
Outdated
// Delete all profile runs. | ||
$delete = $this->profiles->truncate(); | ||
|
||
$this->app->flash('success', 'Deleted all profiles'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected at least 8 spaces, found 6
src/Xhgui/Controller/Run.php
Outdated
|
||
$this->app->flash('success', 'Deleted all profiles'); | ||
|
||
$referrer = $request->getReferrer(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected at least 8 spaces, found 6
tests/Controller/RunTest.php
Outdated
$this->app->expects($this->once()) | ||
->method('redirect'); | ||
|
||
$result = $this->profiles->getAll(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected at least 8 spaces, found 6
tests/Controller/RunTest.php
Outdated
->method('redirect'); | ||
|
||
$result = $this->profiles->getAll(); | ||
$this->assertCount(5, $result['results']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected at least 8 spaces, found 6
tests/Controller/RunTest.php
Outdated
$result = $this->profiles->getAll(); | ||
$this->assertCount(5, $result['results']); | ||
|
||
$this->runs->delete_all(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected at least 8 spaces, found 6
tests/Controller/RunTest.php
Outdated
|
||
$this->runs->delete_all(); | ||
|
||
$result = $this->profiles->getAll(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected at least 8 spaces, found 6
tests/Controller/RunTest.php
Outdated
$this->runs->delete_all(); | ||
|
||
$result = $this->profiles->getAll(); | ||
$this->assertCount(0, $result['results']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line indented incorrectly; expected at least 8 spaces, found 6
Added a link next to the 'search' button to delete all runs as the only other way to truncate the whole profiles database was to go into mongo and drop the database.
Works pretty much like the individual run deletion functionality but it uses the
truncate
function to drop everything.