tests/SortTest.php
/**
     * A test if the Api returns the input in numerical order.
     *
     * @return void
     */
A test if the Api returns the input in numerical order.
@return void
A test if the Api returns the input in numerical order . @return void
public function testOutputIsBubbleSorted()
    {
        $this->post('/sort/api/v1/bubble', ['input' => [23,1,3,4,2,7,1,4,5]]);
        $this->receiveJson(['input' => [23,1,3,4,2,7,1,4,5], 'output' => [1,1,2,3,4,4,5,7,23]]);
        $this->post('/sort/api/v1/bubble', ['input' => [1,1,2,1,1]]);
        $this->receiveJson(['input' => [1,1,2,1,1], 'output' => [1,1,1,1,2]]);
        $this->post('/sort/api/v1/bubble', ['input' => [1,2,3,4,5]]);
        $this->receiveJson(['input' => [1,2,3,4,5], 'output' => [1,2,3,4,5]]);
        $this->post('/sort/api/v1/bubble', ['input' => [5,4,3,2,1]]);
        $this->receiveJson(['input' => [5,4,3,2,1], 'output' => [1,2,3,4,5]]);
    }
public function testOutputIsBubbleSorted ( ) { $ this -> post ( '/sort/api/v1/bubble' , [ 'input' => [ 23 , 1 , 3 , 4 , 2 , 7 , 1 , 4 , 5 ] ] ) ; $ this -> receiveJson ( [ 'input' => [ 23 , 1 , 3 , 4 , 2 , 7 , 1 , 4 , 5 ] , 'output' => [ 1 , 1 , 2 , 3 , 4 , 4 , 5 , 7 , 23 ] ] ) ; $ this -> post ( '/sort/api/v1/bubble' , [ 'input' => [ 1 , 1 , 2 , 1 , 1 ] ] ) ; $ this -> receiveJson ( [ 'input' => [ 1 , 1 , 2 , 1 , 1 ] , 'output' => [ 1 , 1 , 1 , 1 , 2 ] ] ) ; $ this -> post ( '/sort/api/v1/bubble' , [ 'input' => [ 1 , 2 , 3 , 4 , 5 ] ] ) ; $ this -> receiveJson ( [ 'input' => [ 1 , 2 , 3 , 4 , 5 ] , 'output' => [ 1 , 2 , 3 , 4 , 5 ] ] ) ; $ this -> post ( '/sort/api/v1/bubble' , [ 'input' => [ 5 , 4 , 3 , 2 , 1 ] ] ) ; $ this -> receiveJson ( [ 'input' => [ 5 , 4 , 3 , 2 , 1 ] , 'output' => [ 1 , 2 , 3 , 4 , 5 ] ] ) ; }
A test if the Api returns the input in numerical order.
A test if the Api returns the input in numerical order .