Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7929429
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:04:29+00:00 2026-06-03T20:04:29+00:00

For our project I have created a framework on top of the PHPUnit framework

  • 0

For our project I have created a framework on top of the PHPUnit framework which helps us in some of the common tasks in writing unit tests.

This custom framework inherits from PHPUnit_Framework_TestCase and then modifies the mySetup() and adds bunch of useful functions for our code.

<?php

class OurUnitTestFramework extends PHPUnit_Framework_TestCase {

    public $dbMock;
    protected function mySetup (..) { ... }
    protected function testHelper () { ... }

}
?>

Now in our test code we just extend OurUnitTestFramework and then write the tests.

<?php 
require_once ("OurUnitTestFramework");
class DatabaseConnectionTest extends OurUnitTestFramework {
     parent::setUp (..) { ... }
     public function testSomeThing () { ... }
     public function testSomeOtherThing () { ... }

}
?>

Till now we were running all the unit tests through Jenkins and it still is running fine but now when we try to run the tests in a folder it fails. All the tests inside the folder/sub-folder runs successfully but there is one failure:

[sumit@dev model]$ phpunit database
PHPUnit 3.5.14 by Sebastian Bergmann.

F........

Time: 0 seconds, Memory: 10.50Mb

There was 1 failure:

1) Warning
No tests found in class "OurUnitTestFramework".


FAILURES!
Tests: 9, Assertions: 30, Failures: 1.

I have a directory database which has sub directories and all the tests passes from that folder and its subfolder but I get failure from OurUnitTestFramework saying there is no tests found in this custom framework. So I am not able to understand why phpunit is running unit tests on the file which is included/extended in the test file?

We can simply choose to ignore this one error but I wanted to know if okay to leave like this or is there something that I need to configure to make it pass.

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T20:04:31+00:00Added an answer on June 3, 2026 at 8:04 pm

    Make ‘OurUnitTestFramework’ an abstract class.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In our project, we have a plenty of unit tests. They help to keep
In our project we have UI and logic (which may be represented as a
In our Silverlight 2 project we have created an attached property to perform on-the-fly
I am currently working on a project which supports multi-language. I have created a
We have a framework created in .NET which controls hardware devices. The entire framework
I have created a code generator for our project to generate a lot of
I work on a project where we have to create unit tests for all
I want to apply NTFS-Search to our project. Our project have to find the
In our project we have requirement that, after receiving sms message from third party
In our project we have a requirement that when a set of records are

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.