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

Fix appendTitle, prependTitle. Update unit test for append, prepend and setTitle. #12236

Closed
wants to merge 14 commits into from

Conversation

borisdelev
Copy link
Contributor

Update tests for prependTitle and appendTitle functions.
For details: #12233

Update test for setTitle and getTitle: Make sure that getTitle(false) did not return <title> tag element

Update tests for prependTitle and appendTitle functions.
For details:  #12233 

Update test for setTitle and getTitle: Make sure that getTitle(false) did not return <title> tag element
@borisdelev
Copy link
Contributor Author

Hope i make it right now. Sorry for my mistakes :/

@sergeyklay sergeyklay added the testing Tests related issue label Sep 19, 2016
@sergeyklay sergeyklay added this to the 3.0.2 milestone Sep 19, 2016
@virgofx
Copy link
Contributor

virgofx commented Sep 19, 2016

Unit tests look fine ... can we get can update though for the actual Tag implementation so this will pass?

@borisdelev
Copy link
Contributor Author

@virgofx i will try to make this changes too...

Please review that changes. Thanks.
@sergeyklay
Copy link
Contributor

@butamuh4o As you can see tests fails

@borisdelev
Copy link
Contributor Author

borisdelev commented Sep 20, 2016

@sergeyklay I want to ask you to help me with something about a change i was trying to do. Can u check that and give me some details where and what is wrong with syntax? Thank you!!!

    /**
     * Prepends a text to current document title
     */
    public static function prependTitle(var title) -> void
    {
        var prepend = [];
        if self::_documentPrependTitle !== null {
            let prepend = self::_documentPrependTitle ;
        }

        if typeof title == array {
            let prepend = title;
        } else {
            if typeof title == string {
                array_unshift(prepend, title) ;
            }
        }

        if !empty prepend {
            let self::_documentPrependTitle = prepend ;
        }
    }

I want to give some freedom about prepend and append title functions. Maybe it is clear what i want to make: a way to clear prependTitle/appendTitle instead of clear all title elements.

Update: yes, i found my mistake! its that typeof. So stupid. Thanks

Last try to improve prependTitle. Hope i make it now.
I think now its better.
@borisdelev borisdelev changed the title Update unit test for prepend/ append/ getTitle Fix appendTitle, prependTitle. Update unit test for append, prepend and setTitle. Sep 20, 2016
let prepend = self::_documentPrependTitle ;
}

if typeof title == "array" {
Copy link
Contributor

Choose a reason for hiding this comment

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

This is new feature request?

let prepend = null ;
}

let self::_documentPrependTitle = prepend ;
Copy link
Contributor

Choose a reason for hiding this comment

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

So now _documentPrependTitle is array or null and this breaking BC

@borisdelev
Copy link
Contributor Author

No it is not change request. Just think it is better to have that option. Will revert that idea. Sorry

@sergeyklay
Copy link
Contributor

It is good idea, but for 3.1.x not for 3.0.x

@borisdelev borisdelev closed this Sep 20, 2016
@sergeyklay
Copy link
Contributor

@butamuh4o Also could you update CHANGELOG.md?

@borisdelev
Copy link
Contributor Author

borisdelev commented Sep 20, 2016

So i will make a clear pull request and update changelog. Just to get to the office. Thank you!

PS: sorry for that i closed this pull, my phone did that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
testing Tests related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants