コード例 #1
0
ファイル: RESTTest.php プロジェクト: breachofmind/birdmin
 public function test_deleteObject()
 {
     $create = ['name' => 'Test Product', 'description' => 'Test Product Description', 'slug' => 'test', 'status' => 'draft', 'bundle_id' => 1];
     $created = \Birdmin\Product::create($create);
     $this->call('DELETE', $created->objectUrl, ['_token' => csrf_token()]);
     $this->assertResponseStatus(200);
     $model = $this->response->getContent()->getData();
     $this->assertInstanceOf(\Birdmin\Core\Model::class, $model);
     $this->assertEquals($created->id, $model->id);
     // Attempt to fetch should get a 404 status
     $this->call('GET', $created->objectUrl);
     $this->assertResponseStatus(404);
 }
 /**
  * Reverse the migrations.
  *
  * @return void
  */
 public function down()
 {
     ProductBundle::blueprint()->dropSchema();
     ProductVariation::blueprint()->dropSchema();
     Product::blueprint()->dropSchema();
 }