* @expectedException CRM_Extension_Exception
*/
public function testInstallInvalidType() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$testingTypeManager->expects($this->never())
->method('onPreInstall');
$manager = $this->_createManager([
* "the first row" or "all rows".
*/
public function testInstall_Disable_Uninstall() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$manager = $this->_createManager([
self::TESTING_TYPE => $testingTypeManager,
]);
* @throws \CRM_Extension_Exception
*/
public function test_InstallAuto_DisableDownstream_UninstallDownstream() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$manager = $this->_createManager([
self::TESTING_TYPE => $testingTypeManager,
]);
* @throws \CRM_Extension_Exception
*/
public function testInstallAuto_Twice() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$manager = $this->_createManager([
self::TESTING_TYPE => $testingTypeManager,
]);
}
public function test_InstallAuto_DisableUpstream() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$manager = $this->_createManager([
self::TESTING_TYPE => $testingTypeManager,
]);
* Subseuently disable and uninstall.
*/
public function testInstall_DirtyRemove_Disable_Uninstall() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$manager = $this->_createManager([
self::TESTING_TYPE => $testingTypeManager,
]);
* Install an extension with a valid type name.
*/
public function testInstall_Disable_Enable() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$manager = $this->_createManager([
self::TESTING_TYPE => $testingTypeManager,
]);
* Performing 'install' on a 'disabled' extension performs an 'enable'
*/
public function testInstall_Disable_Install() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$manager = $this->_createManager([
self::TESTING_TYPE => $testingTypeManager,
]);
* Install an extension with a valid type name.
*/
public function testEnableBare() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$manager = $this->_createManager([
self::TESTING_TYPE => $testingTypeManager,
]);
* Get the status of an unknown extension.
*/
public function testStatusUnknownKey() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$testingTypeManager->expects($this->never())
->method('onPreInstall');
$manager = $this->_createManager([
* Replace code for an extension that doesn't exist in the container
*/
public function testReplace_Unknown() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$manager = $this->_createManager([
self::TESTING_TYPE => $testingTypeManager,
]);
* Replace code for an extension that doesn't exist in the container
*/
public function testReplace_Uninstalled() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$manager = $this->_createManager([
self::TESTING_TYPE => $testingTypeManager,
]);
* file="oddball", and the upgrade has file="newextension".
*/
public function testReplace_Installed() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$manager = $this->_createManager([
self::TESTING_TYPE => $testingTypeManager,
]);
* file="oddball", and the upgrade has file="newextension".
*/
public function testReplace_InstalledMissing() {
- $mockFunction = $this->mockMethod;
- $testingTypeManager = $this->$mockFunction('CRM_Extension_Manager_Interface');
+ $testingTypeManager = $this->getMockBuilder('CRM_Extension_Manager_Interface')->getMock();
$manager = $this->_createManager([
self::TESTING_TYPE => $testingTypeManager,
]);