public function existTableRow( NodeElement $row, array $columns, array $columnsPositions = null )
    {
        // find which kind of column is in this row
        $elType = $row->find( 'xpath', "/th" );
        $type = ( empty( $elType ) ) ? '/td' : '/th';

        $max = count( $columns );
        for ( $i = 0; $i < $max; $i++ )
        {
            $position = "";
            if ( !empty( $columnsPositions[$i] ) )
            {
                $position = "[{$this->getNumberFromString( $columnsPositions[$i] )}]";
            }

            $el = $row->find( "xpath", "$type$position" );

            // check if match with expected if not return false
            if ( $el === null || $columns[$i] !== $el->getText() )
            {
                return false;
            }
        }

        // if we're here then it means all have ran as expected
        return true;
    }
public function existTableRow( NodeElement $row, array $columns, array $columnsPositions = null )
    {
        // find which kind of column is in this row
        $elType = $row->find( 'xpath', "/th" );
        $type = ( empty( $elType ) ) ? '/td' : '/th';

        $max = count( $columns );
        for ( $i = 0; $i < $max; $i++ )
        {
            $position = "";
            if ( !empty( $columnsPositions[$i] ) )
            {
                $position = "[{$this->getNumberFromString( $columnsPositions[$i] )}]";
            }

            $el = $row->find( "xpath", "$type$position" );

            // check if match with expected if not return false
            if ( $el === null || $columns[$i] !== $el->getText() )
            {
                return false;
            }
        }

        // if we're here then it means all have ran as expected
        return true;
    }
public function existTableRow ( NodeElement $ row , array $ columns , array $ columnsPositions = null ) { // find which kind of column is in this row $ elType = $ row -> find ( 'xpath' , "/th" ) ; $ type = ( empty ( $ elType ) ) ? '/td' : '/th' ; $ max = count ( $ columns ) ; for ( $ i = 0 ; $ i < $ max ; $ i ++ ) { $ position = "" ; if ( ! empty ( $ columnsPositions [ $ i ] ) ) { $ position = "[{$this->getNumberFromString( $columnsPositions[$i] )}]" ; } $ el = $ row -> find ( "xpath" , "$type$position" ) ; // check if match with expected if not return false if ( $ el === null || $ columns [ $ i ] !== $ el -> getText ( ) ) { return false ; } } // if we're here then it means all have ran as expected return true ; }
Verifies if a row as the expected columns, position of columns can be added
for a more accurated assertion

@param \Behat\Mink\Element\NodeElement $row Table row node element
@param string[] $columns Column text to assert
@param string[]|int[] $columnsPositions Columns positions in int or string (number must be in string)

@return boolean

@throws \PHPUnit_Framework_AssertionFailedError
Verifies if a row as the expected columns position of columns can be added for a more accurated assertion