Skip to content

Commit

Permalink
Use mock builder
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo committed Mar 9, 2018
1 parent bbad6fd commit 6d9f9f9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 12 deletions.
7 changes: 3 additions & 4 deletions tests/unit/suites/libraries/cms/model/JModelAdminTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ class JModelAdminTest extends TestCase
public function setUp()
{
// Create mock of abstract class JModelAdmin to test concrete methods in there
$this->object = $this->getMockForAbstractClass(
'JModelAdmin',
[[], $this->getMockBuilder(MVCFactoryInterface::class)->getMock()]
);
$this->object = $this->getMockBuilder('JModelAdmin')
->setConstructorArgs([[], $this->getMockBuilder(MVCFactoryInterface::class)->getMock()])
->getMockForAbstractClass();
}

/**
Expand Down
7 changes: 3 additions & 4 deletions tests/unit/suites/libraries/cms/model/JModelFormTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,9 @@ public function setUp()
$this->saveFactoryState();

// Create mock of abstract class JModelForm to test concrete methods in there
$this->object = $this->getMockForAbstractClass(
'JModelForm',
[[], $this->getMockBuilder(MVCFactoryInterface::class)->getMock()]
);
$this->object = $this->getMockBuilder('JModelForm')
->setConstructorArgs([[], $this->getMockBuilder(MVCFactoryInterface::class)->getMock()])
->getMockForAbstractClass();
$mockApp = $this->getMockCmsApp();
$mockApp->expects($this->any())
->method('getDispatcher')
Expand Down
7 changes: 3 additions & 4 deletions tests/unit/suites/libraries/cms/model/JModelItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ class JModelItemTest extends TestCase
public function setUp()
{
// Create mock of abstract class JModelForm to test concrete methods in there
$this->object = $this->getMockForAbstractClass(
'JModelItem',
[[],$this->getMockBuilder(MVCFactoryInterface::class)->getMock()]
);
$this->object = $this->getMockBuilder('JModelItem')
->setConstructorArgs([[], $this->getMockBuilder(MVCFactoryInterface::class)->getMock()])
->getMockForAbstractClass();
}

/**
Expand Down

0 comments on commit 6d9f9f9

Please sign in to comment.