Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #555 from limingxinleo/1.1-runtime2
Added function swoole_hook_flags.
- Loading branch information
Showing
12 changed files
with
125 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/tests export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,7 @@ | |
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"HyperfTest\\Command\\": "tests/" | ||
} | ||
}, | ||
"require": { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of Hyperf. | ||
* | ||
* @link https://www.hyperf.io | ||
* @document https://doc.hyperf.io | ||
* @contact group@hyperf.io | ||
* @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE | ||
*/ | ||
|
||
namespace HyperfTest\Command\Command; | ||
|
||
use Hyperf\Command\Command; | ||
|
||
class DefaultSwooleFlagsCommand extends Command | ||
{ | ||
public function handle() | ||
{ | ||
} | ||
|
||
public function getHookFlags(): int | ||
{ | ||
return $this->hookFlags; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of Hyperf. | ||
* | ||
* @link https://www.hyperf.io | ||
* @document https://doc.hyperf.io | ||
* @contact group@hyperf.io | ||
* @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE | ||
*/ | ||
|
||
namespace HyperfTest\Command\Command; | ||
|
||
use Hyperf\Command\Command; | ||
|
||
class SwooleFlagsCommand extends Command | ||
{ | ||
protected $hookFlags = SWOOLE_HOOK_CURL | SWOOLE_HOOK_ALL; | ||
|
||
public function handle() | ||
{ | ||
} | ||
|
||
public function getHookFlags(): int | ||
{ | ||
return $this->hookFlags; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
/** | ||
* This file is part of Hyperf. | ||
* | ||
* @link https://www.hyperf.io | ||
* @document https://doc.hyperf.io | ||
* @contact group@hyperf.io | ||
* @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE | ||
*/ | ||
|
||
namespace HyperfTest\Command; | ||
|
||
use HyperfTest\Command\Command\DefaultSwooleFlagsCommand; | ||
use HyperfTest\Command\Command\SwooleFlagsCommand; | ||
use PHPUnit\Framework\TestCase; | ||
|
||
/** | ||
* @internal | ||
* @coversNothing | ||
*/ | ||
class CommandTest extends TestCase | ||
{ | ||
public function testHookFlags() | ||
{ | ||
$command = new DefaultSwooleFlagsCommand('test:demo'); | ||
$this->assertSame(SWOOLE_HOOK_ALL, $command->getHookFlags()); | ||
|
||
$command = new SwooleFlagsCommand('test:demo2'); | ||
$this->assertSame(SWOOLE_HOOK_ALL | SWOOLE_HOOK_CURL, $command->getHookFlags()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters