Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Class not found in custom defect plugin


#1

Hello ,
I use custom defect plugin for Redmine. I copied Redmine.php file and write code for mine. It works well.
But I need extend class Redmine_api. And if I write
class Redmine_api_custom extends Redmine_api
I see error - PHP error: Class ‘Redmine_api’ not found in XXX/custom/defects/Redmine_Custom.php at 794
How correct extend this Class ?

Thank you in advance!


#2

Hi Maria,

You would need to copy the Redmine_api class and then add custom methods or functionality (instead of deriving from this class). You can find the documentation for customizing defect plugins here:

http://docs.gurock.com/testrail-integration/defects-plugins-examples

Cheers,
Tobias


#3

Hello, Tobias
Thank you for your reply !
I read the documentation and for new defect plugin copied file Redmine.php.
Then I added custom methods. But this file has two class: my custom - Redmine_Custom_defect_plugin which extends Defect_plugin and second - class Redmine_api.
Not clear for me how to extend second Class. Please tell me how to write custom methods in the second Class.

Many thanks in advance!
Maria


#4

Hi Maria,

Thanks for your reply. Please just see the documentation above. You would copy the Redmine.php to Redmine_custom.php and then just change the name of the defect plugin class. You can modify the Redmine_api class directly in this file and don’t need to create a new API class based on this.

Cheers,
Tobias


#5

Hello, Tobias
Thank you! I will try to do it.