Problem/Motivation

I noticed that ModalPageHelperService class needs unit test. I'd like to try to work on it.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Comments

gquisini created an issue. See original summary.

gquisini’s picture

Issue summary: View changes
gquisini’s picture

Assigned: Unassigned » gquisini
lucassc’s picture

Status: Active » Needs work
StatusFileSize
new2.27 KB

Hi!

Submitting new patch with mocks and a ModalPageHelperService object.

Edit: sorry but I submitted an outdated patch. @gquisini already got it right, we'll send a new patch soon.

lucassc’s picture

StatusFileSize
new18.8 KB
new18.34 KB

Added tests for:

  • verifyIfUserHasAccessOnModal
  • verifyIfModalIsAvailableForEveryone
  • testGetModalOptions
lucassc’s picture

StatusFileSize
new6.41 KB
new6.21 KB

Once more I submitted the wrong path (not my day e.e). Please, ignore files in #5.

Submitting the correct patch and interdiff.

gquisini’s picture

StatusFileSize
new6.19 KB
new4.67 KB

In this patch, we created some tests to:
- verifyIfUserHasAccessOnModal()
- verifyIfModalIsAvailableForEveryone()
- getModalOptions()

gquisini’s picture

Assigned: gquisini » Unassigned
Status: Needs work » Needs review

Changing status to "needs review" because we're starting to feel stuck.
This is our first unit test, so we may have made some mistakes. Feel free to suggest modifications and improvements, we'll be willing to fix them out.
Kindly review.

paulocs’s picture

Status: Needs review » Needs work

As the $this->setUp(); method is called, can we move the tests bellow to a new test function?

lucassc’s picture

Status: Needs work » Needs review
StatusFileSize
new6.32 KB
new1019 bytes

Good idea, @paulocs!

sophiavs’s picture

I'll do the review

sophiavs’s picture

StatusFileSize
new0 bytes
new538 bytes

I reviewed the concepts of UnitTests and everything seems to be right.
I found one coding standards error on a "true" value that should be "TRUE",

sophiavs’s picture

StatusFileSize
new538 bytes

Sorry i uploaded the interdiff as a .patch instead of .txt

paulocs’s picture

Status: Needs review » Needs work

Patch Failed to Apply. Moving to NW.

sophiavs’s picture

StatusFileSize
new6.32 KB

I saw now that the patch was blank

lucassc’s picture

Status: Needs work » Needs review
lucasbaralm’s picture

Assigned: Unassigned » lucasbaralm

I will review this.

lucasbaralm’s picture

Assigned: lucasbaralm » Unassigned
Status: Needs review » Reviewed & tested by the community

As @sophiavs said, all tests are right, covering all the methods of the ModalPageHelperService class that need to be tested. With the patch from #15 that are no standard issues remaining and as all unit tests work i'm moving to RTBC.

paulocs’s picture

  • 04f92a9 committed on 4.1.x
    Issue #3306890 by lucassc, sophiavs, gquisini, paulocs, lucasbaralm: Add...
paulocs’s picture

Status: Reviewed & tested by the community » Fixed

Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.