示例#1
0
文件: TagTest.php 项目: waavi/tagging
 /**
  * @test
  */
 public function delete_tag()
 {
     $tag = Tag::create(['name' => '9 Ball']);
     $this->assertEquals(1, Tag::count());
     $tag->delete();
     $this->assertEquals(0, Tag::count());
 }
示例#2
0
 public function setUp()
 {
     parent::setUp();
     \Schema::create('posts', function ($table) {
         $table->increments('id');
         $table->string('title')->nullable();
         $table->string('text')->nullable();
         $table->softDeletes();
         $table->timestamps();
     });
     \Schema::create('expenses', function ($table) {
         $table->increments('id');
         $table->string('concept')->nullable();
         $table->integer('price')->nullable();
         $table->softDeletes();
         $table->timestamps();
     });
     $this->post = Post::create(['title' => 'David Alcaide win the world pool championship.', 'text' => 'Lorep ipsum...']);
     $this->post2 = Post::create(['title' => 'Jaime Serrano win the world pool championship.', 'text' => 'Lorep ipsum...']);
     $this->expense = Expense::create(['concept' => 'Lorep ipsum..', 'price' => 10]);
     $this->expense2 = Expense::create(['concept' => 'Lorep ipsum 2..', 'price' => 15]);
     $this->tag1 = Tag::create(['name' => '8 Ball']);
     $this->tag2 = Tag::create(['name' => '9 Ball']);
     $this->tag3 = Tag::create(['name' => '10 Ball']);
 }