File tree 3 files changed +47
-2
lines changed
3 files changed +47
-2
lines changed Original file line number Diff line number Diff line change 15
15
"php" : " >=7.1.0" ,
16
16
"ext-swoole" :" ^4.0" ,
17
17
"easyswoole/swoole-ide-helper" : " ^1.2" ,
18
- "easyswoole/utility" : " ^1.0"
18
+ "easyswoole/utility" : " ^1.0" ,
19
+ "easyswoole/phpunit" : " ^1.0"
19
20
},
20
21
"autoload" : {
21
22
"psr-4" : {
22
- "EasySwoole\\ Component\\ " : " src/"
23
+ "EasySwoole\\ Component\\ " : " src/" ,
24
+ "EasySwoole\\ Component\\ Tests\\ " : " Tests/"
23
25
}
24
26
}
25
27
}
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: yf
5
+ * Date: 2019-01-06
6
+ * Time: 22:48
7
+ */
8
+
9
+ namespace EasySwoole \Component \Tests ;
10
+
11
+
12
+ class PoolObject
13
+ {
14
+ function fuck (){
15
+ return static ::class;
16
+ }
17
+ }
Original file line number Diff line number Diff line change
1
+ <?php
2
+ /**
3
+ * Created by PhpStorm.
4
+ * User: yf
5
+ * Date: 2019-01-06
6
+ * Time: 22:47
7
+ */
8
+
9
+ namespace EasySwoole \Component \Tests ;
10
+
11
+
12
+ use EasySwoole \Component \Pool \PoolManager ;
13
+ use PHPUnit \Framework \TestCase ;
14
+
15
+ class PoolTest extends TestCase
16
+ {
17
+ function testNormalClass ()
18
+ {
19
+ $ pool = PoolManager::getInstance ()->getPool (PoolObject::class);
20
+ /**
21
+ * @var $obj PoolObject
22
+ */
23
+ $ obj = $ pool ->getObj ();
24
+ $ this ->assertEquals (PoolObject::class,$ obj ->fuck ());
25
+ }
26
+ }
You can’t perform that action at this time.
0 commit comments