krystian2160

Experience

43,250

0 Best Reply Awards

  • Member Since 1 Year Ago
  • 425 Lessons Completed
  • 0 Favorites

24th May, 2018

krystian2160 left a reply on Asserting The CurrentUrl? • 2 months ago

But I don't mind laravel dusk tests or other browser tests. Just HTTP tests.

23rd May, 2018

krystian2160 started a new conversation Asserting The CurrentUrl? • 2 months ago

I have tests with the $this->followingRedirects();.

Is there a way to assert the current url? After the redirection? Current url of the response.

21st May, 2018

krystian2160 left a reply on Laravel - When Hitting Web Route Twice In One Test (get Request) • 2 months ago

As I said, everything is fine and gut if i remove these 2 lines

$response = $this->get(route('home'));
        $response->assertSee($goal->name);

As if loads the same view as before, where we can See but we have to not See :) and we doesn't see. It just somehow... sees this

krystian2160 left a reply on Laravel - When Hitting Web Route Twice In One Test (get Request) • 2 months ago

Still. $response->assertDontSee($goal->fresh()->name);

It fails in this assertion. :)

krystian2160 left a reply on Laravel - When Hitting Web Route Twice In One Test (get Request) • 2 months ago

[$user, $goal] = $this->newUserWithNewGoal();
        $text = $this->uniqueText();
    
        $response = $this->get(route('home'));
        $response->assertSee($goal->name);
    
        $this->post(route('commit.store', $goal), [
            'text' => $text,
            'done' => 3,
        ]);
        
        $this->assertTrue($goal->fresh()->done == 3);
    
        $this->refreshApplication();
        Auth::login($user);
        $response = $this->get(route('home'));
        $response->assertDontSee($goal->name);
        $response->assertStatus(Response::HTTP_OK);

krystian2160 started a new conversation Laravel - When Hitting Web Route Twice In One Test (get Request) • 2 months ago

Earlier in the test I have

$response = $this->get(route('home'));
$response->assertSee($goal->name);
Then some action, other lines of code

And then

$response = $this->get(route('home'));
$response->assertDontSee($goal->name);
And the assertion fails. But it shouldn't. It works great! And when I remove earlier two lines of code, I mean:
$response = $this->get(route('home'));
$response->assertSee($goal->name);

Now tests green and everything is fine.

I don't know what this is about, but I guess it's because it hits route('home') twice in the same test. As view is cached? As it gets the same output as before despite the new get request?

I don't know. Tried many things, e.g. $this->refreshApplication(); with no green result. Tried also Artisan::call('view:clear');, still the same.

What to do? What is this about?

19th May, 2018

krystian2160 left a reply on Laravel - Custom SetUp Method Only In Parent Class - Testing • 2 months ago

Thank you, you made me realize something. The problem was wrong use import, wrong class. I mean, class ok... but with wrong namespace. Sad. That there is a use App\Http\Middleware\VerifyCsrfToken; and use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken; -.-, easy to make a mistake, two VerifyCsrfToken

18th May, 2018

krystian2160 left a reply on Laravel Testing - PHPUnit And PHP Fatal Error: Allowed Memory Size • 3 months ago

This is my setUp

protected function setUp()
    {
        parent::setUp();
        $this->withoutMiddleware([VerifyCsrfToken::class]);
        $this->followingRedirects();
    }

krystian2160 started a new conversation Laravel Testing - PHPUnit And PHP Fatal Error: Allowed Memory Size • 3 months ago

...........\php.exe ............../phpunit --configuration .............\phpunit.xml --teamcity
Testing started at 18:53 ...
PHPUnit 7.1.5 by Sebastian Bergmann and contributors.

PHP Fatal error:  Allowed memory size of 134217728 bytes exhausted (tried to allocate 790528 bytes) in E:\XAMPP\htdocs\trzypoziomy\vendor\fzaninotto\faker\src\Faker\Provider\Text.php on line 84
PHP Stack trace:
PHP   1. {main}() E:\XAMPP\htdocs\trzypoziomy\vendor\phpunit\phpunit\phpunit:0
PHP   2. PHPUnit\TextUI\Command::main() E:\XAMPP\htdocs\trzypoziomy\vendor\phpunit\phpunit\phpunit:53
PHP   3. PHPUnit\TextUI\Command->run() E:\XAMPP\htdocs\trzypoziomy\vendor\phpunit\phpunit\src\TextUI\Command.php:151
PHP   4. PHPUnit\TextUI\TestRunner->doRun() E:\XAMPP\htdocs\trzypoziomy\vendor\phpunit\phpunit\src\TextUI\Command.php:198

I have something like this after running many tests and assertions. What to do with it? Is it okay to have this kind of error in testing? And the right solution is to higher the memory?

17th May, 2018

krystian2160 left a reply on Laravel - Custom SetUp Method Only In Parent Class - Testing • 3 months ago

Errors of 419 status code, or that something cannot be seen or that something is not seen in DB...

krystian2160 left a reply on Laravel - Custom SetUp Method Only In Parent Class - Testing • 3 months ago

Tried tests again, both line matters. $this->followingRedirects(); and $this->withoutMiddleware([VerifyCsrfToken::class]);

krystian2160 left a reply on Laravel - Custom SetUp Method Only In Parent Class - Testing • 3 months ago

Yea, it fails every test after pulling this setUp to upper class

krystian2160 left a reply on Laravel - Custom SetUp Method Only In Parent Class - Testing • 3 months ago

Tests are failing, e.g. got 419 errors - that corresponds to followingRedirects or withoutMiddleware I don't remember exactly now but I think it is it - withoutMiddleware

And maybe other errors, didn't try all tests

krystian2160 started a new conversation Laravel - Custom SetUp Method Only In Parent Class - Testing • 3 months ago

My test's custom setUp method looks like this:

protected function setUp() { parent::setUp(); $this->withoutMiddleware([VerifyCsrfToken::class]); $this->followingRedirects(); } I have a class of MyTestCase that extends the default laravel's TestCase

abstract class MyTestCase extends TestCase

I have pushed up many methods and traits use.

But I cannot push this one setUp method. After that everything blows up.

Is it possible to have this setUp method I showed you at the beginning only in my MyTestCase?

Because now I have to duplicate this setUp method in all of my test's classes in order them to work.

14th May, 2018

krystian2160 left a reply on Assert Not Soft Deleted? Inverse? - Laravel Tests • 3 months ago

Haha, I agree. Totally forgot about asserFalse XD haha. Yea :D assertTrue with "!" stupid :D

krystian2160 started a new conversation Assert Not Soft Deleted? Inverse? - Laravel Tests • 3 months ago

Laravels test suite has an assertion called

$this->assertSoftDeleted() But is there the inverse? To assert that something is not soft deleted?

I've tried assertDatabaseHas but doesn't work.

I have done it this way $this->assertTrue(! $goal->fresh()->trashed());

Works perfect.

But is there another, better, more ---elegant--- and laravel's way?

12th November, 2017

6th November, 2017

krystian2160 started a new conversation Annyoing Bugs With Completing Series And Incomplete Series • 9 months ago

When I check to see only incomplete + series I get mix of those... some completed doesn't show and some show. Ugh. That's really annoying and it's a bug.

Plus when I click on series to complete It should complete all episodes of this particular series, but It doesn't. Each episode of the serie is still marked as unwatched and I have to go and mark them manually, each one.

Plus only when I do this - there is just a "chance" that this serie will disappear from uncompleted + series... Only chance. Because it one times happens, other not.

@JeffreyWay

Please fix laracasts bugs :)

14th October, 2017

krystian2160 started a new conversation Jeffrey's Font For Classes And Maybe Something More In PHPStorm • 10 months ago

What is the setting that Jeffrey uses and font, that when he types Class name (maybe other things too) it has special font and exactly this font, and... Just exactly how to + what font

10th October, 2017

krystian2160 started a new conversation Laravel-mix Doesn't Compile Anything - Xampp, Windows 7 • 10 months ago

Laravel-mix doesn't compile anything - Xampp, Windows 7

https://stackoverflow.com/questions/46671709/laravel-mix-on-windows-doesnt-compile-saas-no-errors-in-cmd

Link to stack because I can't post pictures in here and so on

26th September, 2017

krystian2160 left a reply on Jeffrey's Macro For Class Field/property In PHPstorm • 10 months ago

@ChrisSFR but it's something better, I saw this.

But many times in many series we can see he has event better macro I think

8th September, 2017

krystian2160 left a reply on Laravel 5.5 So Slow. Using Windows 7 And Xampp. Why? How To Make This Right? • 11 months ago

Tried with nginx. On xampp 1s Nginx 100-200ms

But still far from 1-10 ms

krystian2160 left a reply on Laravel 5.5 So Slow. Using Windows 7 And Xampp. Why? How To Make This Right? • 11 months ago

I saw many users here have loading time of 1-10 ms. So mine ~ 1 second makes me worried

6th September, 2017

krystian2160 left a reply on Laravel 5.5 So Slow. Using Windows 7 And Xampp. Why? How To Make This Right? • 11 months ago

@Abid with 5.4 I have the same :), I had 5.4 at first, then Upgraded to 5.5

5th September, 2017

krystian2160 started a new conversation Laravel 5.5 So Slow. Using Windows 7 And Xampp. Why? How To Make This Right? • 11 months ago

I am using laravel 5.5, windows 7 and Xampp, below I attached print screen and you can see how much slow this is, how to make this right and improve it? What is the problem here? I think it is something with xampp

http://i.imgur.com/uaXvWqc.png

19th August, 2017

krystian2160 left a reply on Still Getting Old Whoops On Upgrade From 5.4 To 5.5 • 11 months ago

It is not solved. This is problem, in documentation was nothing about adding ""filp/whoops": "~2.0"," to composer.json file.

And you should add it, then it works.

Upgrade documentation isn't complete, doesn't provide full upgrade with everything that is new.

The same with laravel dusk (if missing in composer.json (5.4 have it, 5.5 doesn't in this file) )

krystian2160 started a new conversation Still Getting Old Whoops On Upgrade From 5.4 To 5.5 • 11 months ago

Still getting old whoops on upgrade from 5.4 to 5.5

But when creating new laravel project it works.

Probably not only new whoops is missing when doing upgrade. :<

18th August, 2017

krystian2160 started a new conversation Laravel Can Authorization With Gate Doesn't Work • 1 year ago

I have something like this in view:

@can('sendMessage', $uzytkownik) Wyślij prywatną wiadomość @endcan and this in AuthServiceProvider

Gate::define('sendMessage', function($user, $to) { return 1; //return $to->id !== $user->id AND $to->status === 1; }); //return 1; is for testing why it doesn't work... but I can't find out.

Button isn't seen although we have return 1;, should be always visible.

When I change can to @can('sendMessage') I have error, - to few arguments.

So it see this and work with it

I get it back and then change can to @can('sendMessage') and Gate to Gate::define('sendMessage', function($user)

Now works, and button is seen...

What is going on here? When I got this 2 arg it doesn't work properly

Although this $to thing that we send in view as $uzytkownik is proper users Eloquent Model. All should work

{{ dd(\Illuminate\Support\Facades\Gate::check('sendMessage', $uzytkownik)) }} gives 'false'... we got return 1. What is going on > . >

{{ dd(\Illuminate\Support\Facades\Gate::check('sendMessage', auth()->user(), $uzytkownik)) }} gives false too...

all on return 1, false...

16th August, 2017

krystian2160 left a reply on Jeffrey's Macro For Class Field/property In PHPstorm • 1 year ago

pls someone?

15th August, 2017

krystian2160 started a new conversation Jeffrey's Macro For Class Field/property In PHPstorm • 1 year ago

Sometimes Jeffrey uses this macro, that he type in constructor params fieldname and it creates automatically in constructor and adds to class as new protected property

How to do it? Can't find it anywhere

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.