コード例 #1
0
ファイル: DashboardTest.php プロジェクト: Maksold/platform
 public function testAddAndResetWidgets()
 {
     $widget = $this->getMock('Oro\\Bundle\\DashboardBundle\\Entity\\Widget');
     $widget->expects($this->once())->method('setDashboard')->with($this->dashboard);
     $this->assertFalse($this->dashboard->getWidgets()->contains($widget));
     $this->assertEquals($this->dashboard, $this->dashboard->addWidget($widget));
     $this->assertEquals(1, $this->dashboard->getWidgets()->count());
     $this->assertTrue($this->dashboard->getWidgets()->contains($widget));
     $this->dashboard->resetWidgets();
     $this->assertEquals(0, $this->dashboard->getWidgets()->count());
 }