Update Unit test styling to cover the future coder version
[civicrm-core.git] / tests / phpunit / HelloTest.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
2fe49090 4 | CiviCRM version 5 |
6a488035 5 +--------------------------------------------------------------------+
6b83d5bd 6 | Copyright CiviCRM LLC (c) 2004-2019 |
6a488035
TO
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
d25dd0ee 26 */
6a488035
TO
27
28/**
29 * @file HelloTest.php
30 *
31 * This is a simple test to make sure that you have phpunit
32 * correctly installed and working. The call will look something like:
33 *
34 * <code>
35 * scripts/phpunit HelloTest
36 * </code>
37 *
38 * If your script (which would need to be in HelloTest.php) is found and runs,
39 * UR DOIN IT RIGHT!
40 */
41
4cbe18b8
EM
42/**
43 * Class HelloTest
44 */
6a488035 45class HelloTest extends PHPUnit_Framework_TestCase {
39b959db
SL
46 /**
47 * contains the object handle of the string class
48 * @var string
49 */
50 public $abc;
4cbe18b8
EM
51
52 /**
795492f3 53 * @param string|null $name
4cbe18b8 54 */
00be9182 55 public function __construct($name = NULL) {
6a488035
TO
56 parent::__construct($name);
57 }
58
795492f3 59 /**
eceb18cc 60 * Called before the test functions will be executed.
795492f3
TO
61 * this function is defined in PHPUnit_TestCase and overwritten
62 * here
63 */
00be9182 64 public function setUp() {
6a488035
TO
65 // create a new instance of String with the
66 // string 'abc'
67 $this->abc = "hello";
68 }
69
795492f3 70 /**
eceb18cc 71 * Called after the test functions are executed.
795492f3
TO
72 * this function is defined in PHPUnit_TestCase and overwritten
73 * here.
74 */
00be9182 75 public function tearDown() {
6a488035
TO
76 // delete your instance
77 unset($this->abc);
78 }
79
546b78fa 80 /**
eceb18cc 81 * test the toString function.
546b78fa 82 */
00be9182 83 public function testHello() {
6a488035
TO
84 $result = $this->abc;
85 $expected = 'hello';
86 $this->assertEquals($result, $expected);
87 }
96025800 88
6a488035 89}