hlo, i have a code in php with different functions. i want to test that functionality with php code. plz tell me how this automated test code would be written? individually i had test these functions but there is a requirement of a single code with which all the functions run and give the results.
thanks

Recommended Answers

All 4 Replies

Member Avatar for diafol

That's a bit vague. Are you talking about unit testing? Perhaps if you posted your code and commented on what you need to do?

these files are test cases for individually test each function i.e called unit testing. Now, i want a help to done automation testing using these all functions written in a single code.

** addNewMember.php**

<?php

// Test file
//Function Name:addNewMember
//Class Name :ADAO
//File Name: ADAO.php


require_once("../ADAO.php");

$obj= new ADAO();
$intro_id="247"; 
$pid="247";
$username="jindal1l";
$password="jindal1l";
$first_name="test";
$last_name="jindal";
$address="hsp";
$email="testmlm8@gmail.com";
$phone="7786";
$mobile="911234567890";
$pin="123456";
$city="hsp";
$state="punjab";
$doj="2013-11-26 12:00:10";
$status="2";

$obj->addNewMember($intro_id,$pid,$username,$password,$first_name,$last_name,$address,$email,$phone,$mobile,$pin,$city,$state,$doj,$status);

?>

**inserInMatrix.php**

<?php

// Test file
//Function Name:insertInMatrix
//Class Name :ADAO
//File Name: ADAO.php

require_once("../ADAO.php");
$obj= new ADAO();
$id ="247";
$pid="255";
$obj->insertInMatrix($id,$pid);

?>

**updateParentChildCount**

<?php

// Test file
//Function Name:updateParentChildCount
//Class Name :ADAO
//File Name: ADAO.php

require_once("../ADAO.php");
$obj= new ADAO();
$id ="255";

$obj->updateParentChildCount($id);

?>

updateDirectRefferalIncome

<?php

// Test file
//Function Name:updateDirectRefferalIncome
//Class Name :ADAO
//File Name: ADAO.php

require_once("../ADAO.php");
$obj= new ADAO();
$id ="255";

$obj->updateDirectRefferalIncome($id);

?>

insertInBinary

<?php

// Test file
//Function Name:insertInBinary
//Class Name :ADAO
//File Name: ADAO.php

require_once("../ADAO.php");
$obj= new ADAO();
$user_id ="255";
$pid="247";
$leg="left";
$obj->insertInBinary($user_id,$pid,$leg);

?>

updateBinaryChildCount

<?php

// Test file
//Function Name:updateBinaryChildCounts
//Class Name :ADAO
//File Name: ADAO.php

require_once("../ADAO.php");
$obj= new ADAO();
$user_id ="255";
$pid="255";
$leg="right";

$obj->updateBinaryChildCounts($user_id,$pid,$leg);

?>

createBinaryPaymentAccount

<?php

// Test file
//Function Name:createBinaryPaymentAccount
//Class Name :ADAO
//File Name: ADAO.php

require_once("../ADAO.php");
$obj= new ADAO();
$user_id="255";
$pid ="247";

$obj->createBinaryPaymentAccount($user_id,$pid);

?>

updateBinaryRegularIncome

<?php

// Test file
//Function Name:updateBinaryRegularIncome
//Class Name :ADAO
//File Name: ADAO.php

require_once("../ADAO.php");
$obj= new ADAO();


$obj->updateBinaryRegularIncome();

?>

thnks 4 ur effort but i cann't use any testing tool. I jst write a simple php code through which data inserted into the database

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.