ExampleTest basic
<?php
namespace Tests\Feature;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase;
class ExampleTest extends TestCase
{
/**
* A basic test example.
*
* @return void
*/
public function testBasicTest()
{
$this->assertTrue(true);
}
}
sample 1
/**
* A basic test example.
*
* @return void
*/
public function test_searchByParameters()
{
$this->markTestSkipped( 'PHPUnit will skip this test method' );
$parameters = [
'not_accounts_id' => true,
'user_id' => 9,
'business_unit_id' => 1,
'type_id' => 1,
'like' => 'viajes',
];
$response = $this->post(route('accounts.search_by_parameters'), $parameters)
->assertStatus(200);
//echo __FILE__." on line ".__LINE__,": "; print_r($response); echo "\n";
//echo "<pre>",__FILE__." on line ".__LINE__,": "; exit(); echo "</pre>";
//$this->assertTrue(true);
}
Sample 2
/**
* A basic test example.
*
* @return void
*/
public function test_getByParameters()
{
$this->markTestSkipped();
$response = $this->get('/api/user/getByParameters?id=1');
$response->assertStatus(200);
}
public function test_putUser()
{
$this->markTestSkipped();
$id = 127;
$data = [
'name' => 'prueba',
'email' => '[email protected]',
'code' => 'NONE'
];
$this->put(route('users.update', $id), $data)
->assertStatus(200)
//->assertJson($data)
;
}