Coder Social home page Coder Social logo

Hyperf3兼容 about hyperf-pest HOT 14 CLOSED

DongyunLee avatar DongyunLee commented on June 2, 2024
Hyperf3兼容

from hyperf-pest.

Comments (14)

BadJacky avatar BadJacky commented on June 2, 2024 2

@myxiaoao 官方提供的支持目前在 PHP8.3 with swoole 5.1.1 for Mac 下无法正常工作,大概率我们还是要继续。

有看这个 issue 吗? hyperf/hyperf#3842 (comment)

多谢多谢,之前使用的 prepend 文件是

<?php
require_once __DIR__ . '/../vendor/autoload.php';

defined('BASE_PATH') or define('BASE_PATH', dirname(__DIR__, 1));

(function () {
    \Hyperf\Di\ClassLoader::init();

    \Hyperf\Context\ApplicationContext::setContainer(
        new \Hyperf\Di\Container((new \Hyperf\Di\Definition\DefinitionSourceFactory())())
    );
    
    // $container->get(Hyperf\Contract\ApplicationInterface::class);
})();

看来是我弄错了

但是看起来确实还是有一些问题,比如不明原因报错“API 需要运行在协程环境中”啥的,还是得再踩踩坑

已经解决了,同时可以使用 pest ^2.x 的版本。不过遇到了一些比较奇怪的问题。

  1. 在某些情况下,会出现引入存在的文件的时候提示文件不存在的错误,但是如果在引入时手动 usleep 或者 var_dump 就可以解决问题,但是问题无法百分百复现
  2. 需要变更 phpunit.xml 文件,同时也要修改对应的测试命令。
  3. 我已经完全遗弃了直接使用 phpunit 的任何操作,例如 composer.json,同时我把 test 目录删掉了,仅保留了 pest --init 生成的 pests 目录。

我今天要测验一下有没有其他的隐式问题,如果没有其他隐式问题,我会贴出具体的变更内容。

from hyperf-pest.

DongyunLee avatar DongyunLee commented on June 2, 2024 1

@myxiaoao 官方提供的支持目前在 PHP8.3 with swoole 5.1.1 for Mac 下无法正常工作,大概率我们还是要继续。

有看这个 issue 吗?
hyperf/hyperf#3842 (comment)

from hyperf-pest.

BadJacky avatar BadJacky commented on June 2, 2024 1

@myxiaoao 官方提供的支持目前在 PHP8.3 with swoole 5.1.1 for Mac 下无法正常工作,大概率我们还是要继续。

有看这个 issue 吗? hyperf/hyperf#3842 (comment)

多谢多谢,之前使用的 prepend 文件是

<?php
require_once __DIR__ . '/../vendor/autoload.php';

defined('BASE_PATH') or define('BASE_PATH', dirname(__DIR__, 1));

(function () {
    \Hyperf\Di\ClassLoader::init();

    \Hyperf\Context\ApplicationContext::setContainer(
        new \Hyperf\Di\Container((new \Hyperf\Di\Definition\DefinitionSourceFactory())())
    );
    
    // $container->get(Hyperf\Contract\ApplicationInterface::class);
})();

看来是我弄错了

from hyperf-pest.

myxiaoao avatar myxiaoao commented on June 2, 2024

不好意思,最近是真没时间。

from hyperf-pest.

DongyunLee avatar DongyunLee commented on June 2, 2024

大佬,我看更新了,要不发个 release?

from hyperf-pest.

myxiaoao avatar myxiaoao commented on June 2, 2024

更新了,但是不支持 pest 2,因为默认的 hyperf/testing 还是用的 phpunit 9 的版本。pest 2 需要 phpunit 10 以上的版本。 @DongyunLee

from hyperf-pest.

DongyunLee avatar DongyunLee commented on June 2, 2024

收到,已经帮很大忙了,感谢!

from hyperf-pest.

BadJacky avatar BadJacky commented on June 2, 2024

@DongyunLee 目前 hy 的 phpunit 依赖版本已经改为 phpunit10 辣,大佬有时间搞么?

from hyperf-pest.

DongyunLee avatar DongyunLee commented on June 2, 2024

@DongyunLee 目前 hy 的 phpunit 依赖版本已经改为 phpunit10 辣,大佬有时间搞么?

帮你 @ 正主 @myxiaoao 👀

from hyperf-pest.

BadJacky avatar BadJacky commented on June 2, 2024

@DongyunLee 目前 hyperf 还未发布稳定版本支持 phpunit10

from hyperf-pest.

myxiaoao avatar myxiaoao commented on June 2, 2024

@DongyunLee @BadJacky 官方 3.1 已经默认支持 pest 了, https://github.com/hyperf/hyperf/releases/tag/v3.1.0

from hyperf-pest.

DongyunLee avatar DongyunLee commented on June 2, 2024

@DongyunLee @BadJacky 官方 3.1 已经默认支持 pest 了, https://github.com/hyperf/hyperf/releases/tag/v3.1.0

好的,感谢给我们带来了非常好的 tdd 使用体验,进步离不开每一个贡献者!感谢!致敬!

from hyperf-pest.

BadJacky avatar BadJacky commented on June 2, 2024

@myxiaoao 官方提供的支持目前在 PHP8.3 with swoole 5.1.1 for Mac 下无法正常工作,大概率我们还是要继续。

from hyperf-pest.

DongyunLee avatar DongyunLee commented on June 2, 2024

@myxiaoao 官方提供的支持目前在 PHP8.3 with swoole 5.1.1 for Mac 下无法正常工作,大概率我们还是要继续。

有看这个 issue 吗? hyperf/hyperf#3842 (comment)

多谢多谢,之前使用的 prepend 文件是

<?php
require_once __DIR__ . '/../vendor/autoload.php';

defined('BASE_PATH') or define('BASE_PATH', dirname(__DIR__, 1));

(function () {
    \Hyperf\Di\ClassLoader::init();

    \Hyperf\Context\ApplicationContext::setContainer(
        new \Hyperf\Di\Container((new \Hyperf\Di\Definition\DefinitionSourceFactory())())
    );
    
    // $container->get(Hyperf\Contract\ApplicationInterface::class);
})();

看来是我弄错了

但是看起来确实还是有一些问题,比如不明原因报错“API 需要运行在协程环境中”啥的,还是得再踩踩坑

from hyperf-pest.

Related Issues (1)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.