Skip to content

assertSelectorTextSame bad example #13036

Closed
@flaushi

Description

@flaushi

As discussed in symfony/symfony#35191 (comment),
@xabbuh recommended the docs could be improved by pointing out that the example does work because the html tag is unique.

I oversaw that and tried to assert that at least one th does contain a certain text. However the functions assertSelectorTextContains, assertSelectorTextSame, and assertSelectorTextNotContains will only check the first occurence of the selector, not all occurences. The current example is misleading here. My proposal:

Note: the functions `assertSelectorTextContains`, `assertSelectorTextSame`, and `assertSelectorTextNotContains` will only check the first occurence of the selector, not all occurences. If you want to assert that any match of a selector contains some text, use `$this->assertGreaterThan( 0, $crawler->filter('td.specific:contains("some text")')->count());`

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions