Maison php教程 php手册 PHPUnit初试

PHPUnit初试

Jun 20, 2016 am 08:42 AM

先测试了一下加减,检查一下环境,又调用函数测试了服务器名。

源代码:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

<span style="color: #008080;"> 1</span> <span style="color: #0000ff;">class</span><span style="color: #000000;"> DemoController extends \Think\Controller

</span><span style="color: #008080;"> 2</span> <span style="color: #000000;">{

</span><span style="color: #008080;"> 3</span>

<span style="color: #008080;"> 4</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;"> 5</span> <span style="color: #008000;">     * @assert (5, 8) == 13

</span><span style="color: #008080;"> 6</span> <span style="color: #008000;">     * @assert (16, 76) == 92

</span><span style="color: #008080;"> 7</span> <span style="color: #008000;">     * @assert (6, 16) == 32

</span><span style="color: #008080;"> 8</span> <span style="color: #008000;">     * @assert (6, 4) == 0

</span><span style="color: #008080;"> 9</span> <span style="color: #008000;">     * @assert ('abc', 1) == 2

</span><span style="color: #008080;">10</span> <span style="color: #008000;">     * @param int $a

</span><span style="color: #008080;">11</span> <span style="color: #008000;">     * @param int $b

</span><span style="color: #008080;">12</span> <span style="color: #008000;">     * @return int

</span><span style="color: #008080;">13</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;">14</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function plus($a, $b)

</span><span style="color: #008080;">15</span> <span style="color: #000000;">    {

</span><span style="color: #008080;">16</span>         <span style="color: #0000ff;">return</span> $a +<span style="color: #000000;"> $b;

</span><span style="color: #008080;">17</span> <span style="color: #000000;">    }

</span><span style="color: #008080;">18</span>

<span style="color: #008080;">19</span>      <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;">20</span> <span style="color: #008000;">     * @assert (14, 8) == 6

</span><span style="color: #008080;">21</span> <span style="color: #008000;">     * @assert (16, 6) == 10

</span><span style="color: #008080;">22</span> <span style="color: #008000;">     * @assert (6, 4) == 0

</span><span style="color: #008080;">23</span> <span style="color: #008000;">     * @assert ('45', 1) == 44

</span><span style="color: #008080;">24</span> <span style="color: #008000;">     * @param int $a

</span><span style="color: #008080;">25</span> <span style="color: #008000;">     * @param int $b

</span><span style="color: #008080;">26</span> <span style="color: #008000;">     * @return int

</span><span style="color: #008080;">27</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;">28</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function subtract($a, $b)

</span><span style="color: #008080;">29</span> <span style="color: #000000;">    {

</span><span style="color: #008080;">30</span>         <span style="color: #0000ff;">return</span> $a -<span style="color: #000000;"> $b;

</span><span style="color: #008080;">31</span> <span style="color: #000000;">    }

</span><span style="color: #008080;">32</span>

<span style="color: #008080;">33</span>     <span style="color: #0000ff;">public</span> function connectToServer($serverName = <span style="color: #0000ff;">null</span><span style="color: #000000;">)

</span><span style="color: #008080;">34</span> <span style="color: #000000;">    {

</span><span style="color: #008080;">35</span>         <span style="color: #0000ff;">if</span> ($serverName == <span style="color: #0000ff;">null</span><span style="color: #000000;">) {

</span><span style="color: #008080;">36</span>             <span style="color: #0000ff;">throw</span> <span style="color: #0000ff;">new</span> Exception(<span style="color: #800000;">"</span><span style="color: #800000;">这不是一个服务器名</span><span style="color: #800000;">"</span><span style="color: #000000;">);

</span><span style="color: #008080;">37</span> <span style="color: #000000;">        }

</span><span style="color: #008080;">38</span>         $fp = fsockopen($serverName, <span style="color: #800080;">8080</span><span style="color: #000000;">);

</span><span style="color: #008080;">39</span>         <span style="color: #0000ff;">return</span> ($fp) ? <span style="color: #0000ff;">true</span> : <span style="color: #0000ff;">false</span><span style="color: #000000;">;

</span><span style="color: #008080;">40</span> <span style="color: #000000;">    }

</span><span style="color: #008080;">41</span>

<span style="color: #008080;">42</span>

<span style="color: #008080;">43</span> }

Copier après la connexion

生成测试文件:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

113

114

115

116

117

118

119

120

121

122

123

124

125

126

127

128

129

130

131

132

133

134

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

<span style="color: #008080;">  1</span> <span style="color: #0000ff;">class</span><span style="color: #000000;"> DemoControllerTest extends \PHPUnit_Framework_TestCase

</span><span style="color: #008080;">  2</span> <span style="color: #000000;">{

</span><span style="color: #008080;">  3</span>

<span style="color: #008080;">  4</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;">  5</span> <span style="color: #008000;">     * @var DemoController

</span><span style="color: #008080;">  6</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;">  7</span>     <span style="color: #0000ff;">protected</span> $<span style="color: #0000ff;">object</span><span style="color: #000000;">;

</span><span style="color: #008080;">  8</span>

<span style="color: #008080;">  9</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;"> 10</span> <span style="color: #008000;">     * Sets up the fixture, for example, opens a network connection.

</span><span style="color: #008080;"> 11</span> <span style="color: #008000;">     * This method is called before a test is executed.

</span><span style="color: #008080;"> 12</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;"> 13</span>     <span style="color: #0000ff;">protected</span><span style="color: #000000;"> function setUp()

</span><span style="color: #008080;"> 14</span> <span style="color: #000000;">    {

</span><span style="color: #008080;"> 15</span>         $<span style="color: #0000ff;">this</span>-><span style="color: #0000ff;">object</span> = <span style="color: #0000ff;">new</span><span style="color: #000000;"> DemoController;

</span><span style="color: #008080;"> 16</span> <span style="color: #000000;">    }

</span><span style="color: #008080;"> 17</span>

<span style="color: #008080;"> 18</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;"> 19</span> <span style="color: #008000;">     * Tears down the fixture, for example, closes a network connection.

</span><span style="color: #008080;"> 20</span> <span style="color: #008000;">     * This method is called after a test is executed.

</span><span style="color: #008080;"> 21</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;"> 22</span>     <span style="color: #0000ff;">protected</span><span style="color: #000000;"> function tearDown()

</span><span style="color: #008080;"> 23</span> <span style="color: #000000;">    {

</span><span style="color: #008080;"> 24</span>        

<span style="color: #008080;"> 25</span> <span style="color: #000000;">    }

</span><span style="color: #008080;"> 26</span>

<span style="color: #008080;"> 27</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;"> 28</span> <span style="color: #008000;">     * Generated from @assert (5, 8) == 13.

</span><span style="color: #008080;"> 29</span> <span style="color: #008000;">     *

</span><span style="color: #008080;"> 30</span> <span style="color: #008000;">     * @covers Home\Controller\DemoController::plus

</span><span style="color: #008080;"> 31</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;"> 32</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function testPlus()

</span><span style="color: #008080;"> 33</span> <span style="color: #000000;">    {

</span><span style="color: #008080;"> 34</span>         $<span style="color: #0000ff;">this</span>-><span style="color: #000000;">assertEquals(

</span><span style="color: #008080;"> 35</span>                 <span style="color: #800080;">13</span>, $<span style="color: #0000ff;">this</span>-><span style="color: #0000ff;">object</span>->plus(<span style="color: #800080;">5</span>, <span style="color: #800080;">8</span><span style="color: #000000;">)

</span><span style="color: #008080;"> 36</span> <span style="color: #000000;">        );

</span><span style="color: #008080;"> 37</span> <span style="color: #000000;">    }

</span><span style="color: #008080;"> 38</span>

<span style="color: #008080;"> 39</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;"> 40</span> <span style="color: #008000;">     * Generated from @assert (16, 76) == 92.

</span><span style="color: #008080;"> 41</span> <span style="color: #008000;">     *

</span><span style="color: #008080;"> 42</span> <span style="color: #008000;">     * @covers Home\Controller\DemoController::plus

</span><span style="color: #008080;"> 43</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;"> 44</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function testPlus2()

</span><span style="color: #008080;"> 45</span> <span style="color: #000000;">    {

</span><span style="color: #008080;"> 46</span>         $<span style="color: #0000ff;">this</span>-><span style="color: #000000;">assertEquals(

</span><span style="color: #008080;"> 47</span>                 <span style="color: #800080;">92</span>, $<span style="color: #0000ff;">this</span>-><span style="color: #0000ff;">object</span>->plus(<span style="color: #800080;">16</span>, <span style="color: #800080;">76</span><span style="color: #000000;">)

</span><span style="color: #008080;"> 48</span> <span style="color: #000000;">        );

</span><span style="color: #008080;"> 49</span> <span style="color: #000000;">    }

</span><span style="color: #008080;"> 50</span>

<span style="color: #008080;"> 51</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;"> 52</span> <span style="color: #008000;">     * Generated from @assert (6, 16) == 32.

</span><span style="color: #008080;"> 53</span> <span style="color: #008000;">     *

</span><span style="color: #008080;"> 54</span> <span style="color: #008000;">     * @covers Home\Controller\DemoController::plus

</span><span style="color: #008080;"> 55</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;"> 56</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function testPlus3()

</span><span style="color: #008080;"> 57</span> <span style="color: #000000;">    {

</span><span style="color: #008080;"> 58</span>         $<span style="color: #0000ff;">this</span>-><span style="color: #000000;">assertEquals(

</span><span style="color: #008080;"> 59</span>                 <span style="color: #800080;">32</span>, $<span style="color: #0000ff;">this</span>-><span style="color: #0000ff;">object</span>->plus(<span style="color: #800080;">6</span>, <span style="color: #800080;">16</span><span style="color: #000000;">)

</span><span style="color: #008080;"> 60</span> <span style="color: #000000;">        );

</span><span style="color: #008080;"> 61</span> <span style="color: #000000;">    }

</span><span style="color: #008080;"> 62</span>

<span style="color: #008080;"> 63</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;"> 64</span> <span style="color: #008000;">     * Generated from @assert (6, 4) == 0.

</span><span style="color: #008080;"> 65</span> <span style="color: #008000;">     *

</span><span style="color: #008080;"> 66</span> <span style="color: #008000;">     * @covers Home\Controller\DemoController::plus

</span><span style="color: #008080;"> 67</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;"> 68</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function testPlus4()

</span><span style="color: #008080;"> 69</span> <span style="color: #000000;">    {

</span><span style="color: #008080;"> 70</span>         $<span style="color: #0000ff;">this</span>-><span style="color: #000000;">assertEquals(

</span><span style="color: #008080;"> 71</span>                 <span style="color: #800080;">0</span>, $<span style="color: #0000ff;">this</span>-><span style="color: #0000ff;">object</span>->plus(<span style="color: #800080;">6</span>, <span style="color: #800080;">4</span><span style="color: #000000;">)

</span><span style="color: #008080;"> 72</span> <span style="color: #000000;">        );

</span><span style="color: #008080;"> 73</span> <span style="color: #000000;">    }

</span><span style="color: #008080;"> 74</span>

<span style="color: #008080;"> 75</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;"> 76</span> <span style="color: #008000;">     * Generated from @assert ('abc', 1) == 0.

</span><span style="color: #008080;"> 77</span> <span style="color: #008000;">     *

</span><span style="color: #008080;"> 78</span> <span style="color: #008000;">     * @covers Home\Controller\DemoController::plus

</span><span style="color: #008080;"> 79</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;"> 80</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function testPlus5()

</span><span style="color: #008080;"> 81</span> <span style="color: #000000;">    {

</span><span style="color: #008080;"> 82</span>         $<span style="color: #0000ff;">this</span>-><span style="color: #000000;">assertEquals(

</span><span style="color: #008080;"> 83</span>                 <span style="color: #800080;">2</span>, $<span style="color: #0000ff;">this</span>-><span style="color: #0000ff;">object</span>->plus(<span style="color: #800000;">'</span><span style="color: #800000;">abc</span><span style="color: #800000;">'</span>, <span style="color: #800080;">1</span><span style="color: #000000;">)

</span><span style="color: #008080;"> 84</span> <span style="color: #000000;">        );

</span><span style="color: #008080;"> 85</span> <span style="color: #000000;">    }

</span><span style="color: #008080;"> 86</span>

<span style="color: #008080;"> 87</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;"> 88</span> <span style="color: #008000;">     * Generated from @assert (14, 8) == 6.

</span><span style="color: #008080;"> 89</span> <span style="color: #008000;">     *

</span><span style="color: #008080;"> 90</span> <span style="color: #008000;">     * @covers Home\Controller\DemoController::subtract

</span><span style="color: #008080;"> 91</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;"> 92</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function testSubtract()

</span><span style="color: #008080;"> 93</span> <span style="color: #000000;">    {

</span><span style="color: #008080;"> 94</span>         $<span style="color: #0000ff;">this</span>-><span style="color: #000000;">assertEquals(

</span><span style="color: #008080;"> 95</span>                 <span style="color: #800080;">6</span>, $<span style="color: #0000ff;">this</span>-><span style="color: #0000ff;">object</span>->subtract(<span style="color: #800080;">14</span>, <span style="color: #800080;">8</span><span style="color: #000000;">)

</span><span style="color: #008080;"> 96</span> <span style="color: #000000;">        );

</span><span style="color: #008080;"> 97</span> <span style="color: #000000;">    }

</span><span style="color: #008080;"> 98</span>

<span style="color: #008080;"> 99</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;">100</span> <span style="color: #008000;">     * Generated from @assert (16, 6) == 10.

</span><span style="color: #008080;">101</span> <span style="color: #008000;">     *

</span><span style="color: #008080;">102</span> <span style="color: #008000;">     * @covers Home\Controller\DemoController::subtract

</span><span style="color: #008080;">103</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;">104</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function testSubtract2()

</span><span style="color: #008080;">105</span> <span style="color: #000000;">    {

</span><span style="color: #008080;">106</span>         $<span style="color: #0000ff;">this</span>-><span style="color: #000000;">assertEquals(

</span><span style="color: #008080;">107</span>                 <span style="color: #800080;">10</span>, $<span style="color: #0000ff;">this</span>-><span style="color: #0000ff;">object</span>->subtract(<span style="color: #800080;">16</span>, <span style="color: #800080;">6</span><span style="color: #000000;">)

</span><span style="color: #008080;">108</span> <span style="color: #000000;">        );

</span><span style="color: #008080;">109</span> <span style="color: #000000;">    }

</span><span style="color: #008080;">110</span>

<span style="color: #008080;">111</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;">112</span> <span style="color: #008000;">     * Generated from @assert (6, 4) == 0.

</span><span style="color: #008080;">113</span> <span style="color: #008000;">     *

</span><span style="color: #008080;">114</span> <span style="color: #008000;">     * @covers Home\Controller\DemoController::subtract

</span><span style="color: #008080;">115</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;">116</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function testSubtract3()

</span><span style="color: #008080;">117</span> <span style="color: #000000;">    {

</span><span style="color: #008080;">118</span>         $<span style="color: #0000ff;">this</span>-><span style="color: #000000;">assertEquals(

</span><span style="color: #008080;">119</span>                 <span style="color: #800080;">0</span>, $<span style="color: #0000ff;">this</span>-><span style="color: #0000ff;">object</span>->subtract(<span style="color: #800080;">6</span>, <span style="color: #800080;">4</span><span style="color: #000000;">)

</span><span style="color: #008080;">120</span> <span style="color: #000000;">        );

</span><span style="color: #008080;">121</span> <span style="color: #000000;">    }

</span><span style="color: #008080;">122</span>

<span style="color: #008080;">123</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;">124</span> <span style="color: #008000;">     * Generated from @assert ('abc', 1) == 0.

</span><span style="color: #008080;">125</span> <span style="color: #008000;">     *

</span><span style="color: #008080;">126</span> <span style="color: #008000;">     * @covers Home\Controller\DemoController::subtract

</span><span style="color: #008080;">127</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;">128</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function testSubtract4()

</span><span style="color: #008080;">129</span> <span style="color: #000000;">    {

</span><span style="color: #008080;">130</span>         $<span style="color: #0000ff;">this</span>-><span style="color: #000000;">assertEquals(

</span><span style="color: #008080;">131</span>                 <span style="color: #800080;">44</span>, $<span style="color: #0000ff;">this</span>-><span style="color: #0000ff;">object</span>->subtract(<span style="color: #800000;">'</span><span style="color: #800000;">45</span><span style="color: #800000;">'</span>, <span style="color: #800080;">1</span><span style="color: #000000;">)

</span><span style="color: #008080;">132</span> <span style="color: #000000;">        );

</span><span style="color: #008080;">133</span> <span style="color: #000000;">    }

</span><span style="color: #008080;">134</span>

<span style="color: #008080;">135</span>     <span style="color: #008000;">/*</span><span style="color: #008000;">*

</span><span style="color: #008080;">136</span> <span style="color: #008000;">     * @covers Home\Controller\DemoController::connectToServer

</span><span style="color: #008080;">137</span> <span style="color: #008000;">     * @todo   Implement testConnectToServer().

</span><span style="color: #008080;">138</span>      <span style="color: #008000;">*/</span>

<span style="color: #008080;">139</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function testConnectToServer()

</span><span style="color: #008080;">140</span> <span style="color: #000000;">    {

</span><span style="color: #008080;">141</span> <span style="color: #008000;">//</span>        <span style="color: #008000;">//</span><span style="color: #008000;"> Remove the following lines when you implement this test.

</span><span style="color: #008080;">142</span> <span style="color: #008000;">//</span><span style="color: #008000;">        $this->markTestIncomplete(

</span><span style="color: #008080;">143</span> <span style="color: #008000;">//</span><span style="color: #008000;">                'This test has not been implemented yet.'

</span><span style="color: #008080;">144</span> <span style="color: #008000;">//</span><span style="color: #008000;">        );</span>

<span style="color: #008080;">145</span>         $serverName = <span style="color: #800000;">'</span><span style="color: #800000;">wwwcom</span><span style="color: #800000;">'</span><span style="color: #000000;">;

</span><span style="color: #008080;">146</span>         $<span style="color: #0000ff;">this</span>->assertTrue($<span style="color: #0000ff;">this</span>-><span style="color: #0000ff;">object</span>->connectToServer($serverName) === <span style="color: #0000ff;">false</span><span style="color: #000000;">);

</span><span style="color: #008080;">147</span> <span style="color: #000000;">    }

</span><span style="color: #008080;">148</span>     <span style="color: #0000ff;">public</span><span style="color: #000000;"> function testConnectToServer2()

</span><span style="color: #008080;">149</span> <span style="color: #000000;">    {

</span><span style="color: #008080;">150</span>         $serverName = <span style="color: #800000;">'</span><span style="color: #800000;">www.baidu.com</span><span style="color: #800000;">'</span><span style="color: #000000;">;

</span><span style="color: #008080;">151</span>         $<span style="color: #0000ff;">this</span>->assertTrue($<span style="color: #0000ff;">this</span>-><span style="color: #0000ff;">object</span>->connectToServer($serverName) !== <span style="color: #0000ff;">false</span><span style="color: #000000;">);

</span><span style="color: #008080;">152</span>     }

Copier après la connexion

这里的服务器测试用例是手动加上去的!

执行结果:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

<span style="color: #008080;"> 1</span> ..FFF..F..F                                                       <span style="color: #800080;">11</span> / <span style="color: #800080;">11</span> (<span style="color: #800080;">100</span>%<span style="color: #000000;">)

</span><span style="color: #008080;"> 2</span>

<span style="color: #008080;"> 3</span> Time: <span style="color: #800080;">44.42</span> seconds, Memory: <span style="color: #800080;">8</span><span style="color: #000000;">.75Mb

</span><span style="color: #008080;"> 4</span>

<span style="color: #008080;"> 5</span> There were <span style="color: #800080;">5</span><span style="color: #000000;"> failures:

</span><span style="color: #008080;"> 6</span>

<span style="color: #008080;"> 7</span> <span style="color: #800080;">1</span><span style="color: #000000;">) Home\Controller\DemoControllerTest::testPlus3

</span><span style="color: #008080;"> 8</span> Failed asserting that <span style="color: #800080;">22</span> matches expected <span style="color: #800080;">32</span><span style="color: #000000;">.

</span><span style="color: #008080;"> 9</span>

<span style="color: #008080;">10</span> D:\wamp\www\wxportal\tests\Application\Home\Controller\DemoController.classTest.php:<span style="color: #800080;">67</span>

<span style="color: #008080;">11</span>

<span style="color: #008080;">12</span> <span style="color: #800080;">2</span><span style="color: #000000;">) Home\Controller\DemoControllerTest::testPlus4

</span><span style="color: #008080;">13</span> Failed asserting that <span style="color: #800080;">10</span> matches expected <span style="color: #800080;">0</span><span style="color: #000000;">.

</span><span style="color: #008080;">14</span>

<span style="color: #008080;">15</span> D:\wamp\www\wxportal\tests\Application\Home\Controller\DemoController.classTest.php:<span style="color: #800080;">79</span>

<span style="color: #008080;">16</span>

<span style="color: #008080;">17</span> <span style="color: #800080;">3</span><span style="color: #000000;">) Home\Controller\DemoControllerTest::testPlus5

</span><span style="color: #008080;">18</span> Failed asserting that <span style="color: #800080;">1</span> matches expected <span style="color: #800080;">2</span><span style="color: #000000;">.

</span><span style="color: #008080;">19</span>

<span style="color: #008080;">20</span> D:\wamp\www\wxportal\tests\Application\Home\Controller\DemoController.classTest.php:<span style="color: #800080;">91</span>

<span style="color: #008080;">21</span>

<span style="color: #008080;">22</span> <span style="color: #800080;">4</span><span style="color: #000000;">) Home\Controller\DemoControllerTest::testSubtract3

</span><span style="color: #008080;">23</span> Failed asserting that <span style="color: #800080;">2</span> matches expected <span style="color: #800080;">0</span><span style="color: #000000;">.

</span><span style="color: #008080;">24</span>

<span style="color: #008080;">25</span> D:\wamp\www\wxportal\tests\Application\Home\Controller\DemoController.classTest.php:<span style="color: #800080;">127</span>

<span style="color: #008080;">26</span>

<span style="color: #008080;">27</span> <span style="color: #800080;">5</span><span style="color: #000000;">) Home\Controller\DemoControllerTest::testConnectToServer2

</span><span style="color: #008080;">28</span> Failed asserting that <span style="color: #0000ff;">false</span> <span style="color: #0000ff;">is</span> <span style="color: #0000ff;">true</span><span style="color: #000000;">.

</span><span style="color: #008080;">29</span>

<span style="color: #008080;">30</span> D:\wamp\www\wxportal\tests\Application\Home\Controller\DemoController.classTest.php:<span style="color: #800080;">158</span>

<span style="color: #008080;">31</span>

<span style="color: #008080;">32</span> FAILURES!

<span style="color: #008080;">33</span> Tests: <span style="color: #800080;">11</span>, Assertions: <span style="color: #800080;">11</span>, Failures: <span style="color: #800080;">5</span><span style="color: #000000;">.

</span><span style="color: #008080;">34</span> 完成。

Copier après la connexion

 

Déclaration de ce site Web
Le contenu de cet article est volontairement contribué par les internautes et les droits d'auteur appartiennent à l'auteur original. Ce site n'assume aucune responsabilité légale correspondante. Si vous trouvez un contenu suspecté de plagiat ou de contrefaçon, veuillez contacter admin@php.cn

Outils d'IA chauds

Undresser.AI Undress

Undresser.AI Undress

Application basée sur l'IA pour créer des photos de nu réalistes

AI Clothes Remover

AI Clothes Remover

Outil d'IA en ligne pour supprimer les vêtements des photos.

Undress AI Tool

Undress AI Tool

Images de déshabillage gratuites

Clothoff.io

Clothoff.io

Dissolvant de vêtements AI

AI Hentai Generator

AI Hentai Generator

Générez AI Hentai gratuitement.

Article chaud

R.E.P.O. Crystals d'énergie expliqués et ce qu'ils font (cristal jaune)
2 Il y a quelques semaines By 尊渡假赌尊渡假赌尊渡假赌
Repo: Comment relancer ses coéquipiers
1 Il y a quelques mois By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: Comment obtenir des graines géantes
1 Il y a quelques mois By 尊渡假赌尊渡假赌尊渡假赌
Combien de temps faut-il pour battre Split Fiction?
4 Il y a quelques semaines By DDD

Outils chauds

Bloc-notes++7.3.1

Bloc-notes++7.3.1

Éditeur de code facile à utiliser et gratuit

SublimeText3 version chinoise

SublimeText3 version chinoise

Version chinoise, très simple à utiliser

Envoyer Studio 13.0.1

Envoyer Studio 13.0.1

Puissant environnement de développement intégré PHP

Dreamweaver CS6

Dreamweaver CS6

Outils de développement Web visuel

SublimeText3 version Mac

SublimeText3 version Mac

Logiciel d'édition de code au niveau de Dieu (SublimeText3)