src/Sylius/Bundle/WebBundle/Behat/WebContext.php
/**
     * @Then I should see table of :id sorted by lastName
     */
@Then I should see table of :id sorted by lastName
@Then I should see table of : id sorted by lastName
public function iShouldSeeTableSortedByLastName($id)
    {
        $allNames = $this->getSession()->getPage()->findAll('css', '#'.$id.' > tbody > tr > td > p');
        $allSurnames = array();
        foreach ($allNames as $name){
            $spacePosition = strpos($name->getText(), ' ');
            $surname = substr($name->getText(), $spacePosition + 1);
            $allSurnames[] .= $surname;
        }
        sort($allSurnames);
        $this->assertSession()->elementTextContains('css', '#'.$id.' > tbody > tr > td > p', $allSurnames[0]);
    }
public function iShouldSeeTableSortedByLastName ( $ id ) { $ allNames = $ this -> getSession ( ) -> getPage ( ) -> findAll ( 'css' , '#' . $ id . ' > tbody > tr > td > p' ) ; $ allSurnames = array ( ) ; foreach ( $ allNames as $ name ) { $ spacePosition = strpos ( $ name -> getText ( ) , ' ' ) ; $ surname = substr ( $ name -> getText ( ) , $ spacePosition + 1 ) ; $ allSurnames [ ] .= $ surname ; } sort ( $ allSurnames ) ; $ this -> assertSession ( ) -> elementTextContains ( 'css' , '#' . $ id . ' > tbody > tr > td > p' , $ allSurnames [ 0 ] ) ; }
@Then I should see table of :id sorted by lastName
@Then I should see table of : id sorted by lastName