DEV Community

Cover image for Building a Simple Blog with Flight - Part 1

Building a Simple Blog with Flight - Part 1

n0nag0n on July 04, 2024

Hey everyone! I figured it was time to showcase some of the new features that have been added to the Flight Framework for PHP. Earlier this year th...
Collapse
 
cobrob profile image
Rob •

I don't think this is the right way to showcase a framework. I'm quite frustrated and probably wasting my time... I downloaded the code from Github, but it immediately gave me errors, so I decided to follow this tutorial step-by-step, but just after installing active-record and trying to create the first table I get the error:

Fatal error: Uncaught Error: Class "PHPUnit\Framework\TestCase" not found in C:\Develop\PHP\blogger\vendor\flightphp\active-record\tests\commands\RecordCommandTest.php:12
Stack trace:
#0 C:\Develop\PHP\blogger\vendor\flightphp\runway\runway(102): require()
#1 C:\Develop\PHP\blogger\vendor\bin\runway(119): include('C:\\Develop\\PHP\\...')
#2 {main}
  thrown in C:\Develop\PHP\blogger\vendor\flightphp\active-record\tests\commands\RecordCommandTest.php on line 12

Enter fullscreen mode Exit fullscreen mode

I see that this has already been reported, so I followed your previous suggestion, and I tried updating runway, but the end result is the same. Is there a known solution to this?
Thanks!

Collapse
 
n0nag0n profile image
n0nag0n •

Hey! Thanks for letting me know! I just created a project a couple days ago and noticed this as well. I pushed a new update to runway and this problem is fixed! Just run composer update and you should be golden.

Collapse
 
Sloan, the sloth mascot
Comment deleted
Collapse
 
n0nag0n profile image
n0nag0n •

Did you install this with --no-dev ?

Collapse
 
Sloan, the sloth mascot
Comment deleted
 
n0nag0n profile image
n0nag0n •

Looks like there was a bug someone found in runway that might be the cause of this. run composer update flightphp/runway and see if that fixes it. Should update to 1.1.1

Thread Thread
 
Sloan, the sloth mascot
Comment deleted
 
n0nag0n profile image
n0nag0n •

Are you on Windows? I've noticed that Windows can't create the symlinks which might be what you're running into. You'll have to run it fully with php vendor/bin/runway init:sample-db

Collapse
 
ust-balyk profile image
Мастер • • Edited

mysql -

Return type of flight\debug\database\PdoQueryCapture::exec($statement) should either be compatible with PDO::exec(string $statement): int|false, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice
(MAMP version 7.0)

Collapse
 
n0nag0n profile image
n0nag0n •

So just make sure you install the right version of flightphp/tracy-extensions. There's a version for 7.4 and a version for 8+. That's the problem you're running into.

Collapse
 
ust-balyk profile image
Мастер •

is it a fantasy novel?)

Collapse
 
n0nag0n profile image
n0nag0n •

No I promise it's not :)

Collapse
 
ust-balyk profile image
Мастер • • Edited

The same problem..., PHPUnit\Framework\TestCase