I'm new to PHP and i want to understand the following case and how to find a working solution.
I have two script config.php
and index.php
Config.php
<?php
$ip = 'localhost';
$username ='patrick';
$password = 'password';
?>
Index.php
<?php
require 'config.php';
class index extends PHPUnit_Framework_TestCase{
private $index;
protected function setUp()
{
$this->index= NULL;
}
protected function tearDown()
{
$this->index= NULL;
}
public function testGetConfig()
{
echo $ip // How do I pass the value to this function?
}
}
?>
How do I pass the value from a script to the function in a class.