Skip to content
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

BUG FIX - Uncaught exception when accessing admin with none existent use... #2

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion app/code/core/Mage/Admin/Model/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,11 @@ public function reload()
*/
public function loadByUsername($username)
{
$this->setData($this->getResource()->loadByUsername($username));
$user = $this->getResource()->loadByUsername($username);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would you like to practice implementing an integration test for this method?
Supposedly dev/tests/integration/testsuite/Mage/Admin/Model/UserTest.php -- it doesn't exist yet. But implementing just loadByUsernameTest() would be enough.

I recommend using @magentoDataFixture to create a test admin account fixture. The fixture will be reverted automatically after test execution.

if ($user) {
$this->setData($user);
}

return $this;
}

Expand Down