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

  • SEARCH
  • Home
  • 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 8002987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:32:00+00:00 2026-06-04T16:32:00+00:00

Hy guys I´m trying to include a function from a php-file to my phpunittest.

  • 0

Hy guys

I´m trying to include a function from a php-file to my phpunittest.

When i do not include it, it works fine. I already tried some different solutions with i found while googleing…

There is no error message, it is not even starting to run the test.

I want something like that:

this should be the included function in mappingfunction.php

<?php
  public function mapping(string catname)
  {
    echo ($catname);

  } ?>

This should be the PhpUnit-test:

<?php

require_once '/mappingfunction.php' ;

class Example extends PHPUnit_Extensions_SeleniumTestCase
{
  protected function setUp()
  {
    $this->setBrowser("firefox");
    $this->setBrowserUrl("http://www.google.com");
    $this->setHost("localhost");
    $this->setPort(4444);
  }

  public function testMyTestCase()
  {

    mapping('blabla');

  }
}  ?>

Why is it not working? What could I do instead?

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-04T16:32:01+00:00Added an answer on June 4, 2026 at 4:32 pm

    works without the slash 🙂

    require_once 'mappingfunction.php' ;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi guys I'm trying the code samples from zend frameworks site on how to
hello guys I am trying to extract all the anchor links from aol but
Hi guys i am trying to create one simple make file and execute in
hello guys i am trying to print title from a set of urls in
Hey guys, I'm trying to compute the cumulative distribution function of the standard normal
Guys, I'm trying to finish up my homework but I'm having some problems here
Guys I was trying in VS to do something like: #ifdef _MSC_VER #include stdafx.h
Hey guys I've been trying all day to get an ant file to automatically
Hey guys I'm working on a chunk of my function and trying to keep
Hey guys, Im trying to migrate django-cms from version 2.1.0 beta3 to 2.1.3 (stable),

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.