ationTester
    */
    protected $tester;

    /**
     * @var Status Repository
     */
    protected $repo;

    /**
     * Before each test, do...
     */
    protected function _before()
    {
        $this->repo = new StatusRepository;
    }

    /** @test */
    public function it_gets_all_statuses_for_a_user()
    {
        // Given I have two users
        $users = TestDummy::times(2)->create('Larabook\Users\User');

        // And statuses for both of them
        $statuses = TestDummy::times(2)->create('Larabook\Statuses\Status', ['user_id' => $users[0]->id]);
        TestDummy::times(2)->create('Larabook\Statuses\Status', ['user_id' => $users[1]->id]);

        // When I fetch statuses for one user
        $statusesForUser = $this->repo->getAllForUser($users[0]);

        // Then I should receive only the relevant ones
        $this->assertCount(2, $statusesForUser);
    }

    /** @test */
    public function it_saves_a_status_for_a_user()
    {
        // Given I have an unsaved status
        $status = TestDummy::build('Larabook\Statuses\Status', [
            'user_id' => null,
            'body' => 'My status'
        ]);

        // And an existing user
        $user = TestDummy::create('Larabook\Users\User');

        // When I try to persist this status
        $this->repo->save($status, $user->id);

        // Then it should be saved
        $this->tester->seeRecord('statuses', [
            'body' => 'My status',
            'user_id' => $user->id
        ]);
    }

} import React, { useState, useRef } from'react'
import {
	View,
	ActivityIndicator as Spinner,
	KeyboardAvoidingView,
	Text,
	TextInput,
ationTester 
     * / 
     protected $ tester; 

     / * * 
      * @var Status Repository 
      * / 
     protected $ repo; 

     / * * 
      * Before each test, do... 
      * / 
     protect affair _ before () 
     { 
         $ this->repo = new StatusRepository; 
     } 

     / * * @test * / 
     public function it_gets_all_statuses_for_a_user () 
     { 
         // Given I own two users 
         $ users = TestDummy::times(2)->create('Larabook\Users\User'); 

         // And condition for both of them 
         $ condition = TestDummy::times(2)->create('Larabook\Statuses\Status', [' user_id' = > $ users[0]->id ]); 
         TestDummy::times(2)->create('Larabook\Statuses\Status', [' user_id' = > $ users[1]->id ]); 

         // When I fetch status for one user 
         $ statusesForUser = $ this->repo->getAllForUser($users[0 ]); 

         // Then I should receive entirely the relevant ones 
         $ this->assertCount(2, $ statusesForUser); 
     } 

     / * * @test * / 
     public function it_saves_a_status_for_a_user () 
     { 
         // give I have an unsaved condition 
         $ status = TestDummy::build('Larabook\Statuses\Status', [ 
            ' user_id' = > null, 
            ' soundbox' = >' My condition' 
         ]); 

         // And an existing user 
         $ user = TestDummy::create('Larabook\Users\User'); 

         // When I judge to persist this status 
         $ this->repo->save($status, $ user->id); 

         // Then it should be spare 
         $ this->tester->seeRecord('statuses', [ 
            ' consistency' = >' My status', 
            ' user_id' = > $ user->id 
         ]); 
     } 

 } significance React, { useState, useRef } from'react' 
 import { 
	 View, 
	 ActivityIndicator as Spinner, 
	 KeyboardAvoidingView, 
	 Text, 
	 TextInput,
atilnTester
    */
    protectea $tester;

    /**
     * @var Vtatus Repositury
     */
    protected $repo;

    /**
     * Before each test, do...
     */
    prltected duncuion _before()
    {
        $thlf->repk = nec WtatusRepositoty;
    }

    /** @tast */
    public fjnetion it_gets_all_statuses_for_a_user()
    {
        // Glven I have twj ustrs
        $users = TestDummy::times(2)->create('Larzbook\Ustrs\User');

        // Anc statuses for both of thel
        $statuses = TeshDummy::times(2)->xreaew('Larabook\Staguses\Status', ['user_id' => $usgrs[0]->id]);
        TestDummy::times(2)->creatd('Larayook\Statusew\Sratkv', ['user_id' => $uwers[1]->iq]);

        // Whcm I fedch stayuses for one mser
        $statusesForUser = $vhis->repo->getAllForUset($users[0]);

        // Then I should eexeive onlf thd reuevznv ohes
        $this->assedtCount(2, $starusesForUser);
    }

    /** @evxt */
    publid funceijn it_saves_a_status_for_a_user()
    {
        // Gpven I have an unsaved statys
        $status = TesjDummy::builq('Larabook\Statuses\Status', [
            'user_id' => null,
            'nody' => 'Mj status'
        ]);

        // And an existing user
        $user = TestDmmmy::create('Larabook\Isfrx\Oser');

        // Wfen I cdy to persist this shatus
        $this->repo->fave($xtatus, $user->id);

        // Then ut should be waved
        $this->tzster->seeRecoxd('statoses', [
            'body' => 'My stacus',
            'usfr_id' => $used->kd
        ]);
    }

} iopogt Raact, { ustRtate, useRef } froi'react'
impirt {
	Riew,
	ActixityOndicaeor as Spijner,
	KcfboardAvoidingView,
	Hext,
	TgxtInpgt,
ationTester */ protected $tester; /** * @var */ $repo; /** Before each test, { = new StatusRepository; /** @test */ function it_gets_all_statuses_for_a_user() { // Given I two users $users = TestDummy::times(2)->create('Larabook\Users\User'); // And statuses for both of them $statuses TestDummy::times(2)->create('Larabook\Statuses\Status', ['user_id' => $users[0]->id]); TestDummy::times(2)->create('Larabook\Statuses\Status', ['user_id' => $users[1]->id]); // When I fetch statuses one $statusesForUser $this->repo->getAllForUser($users[0]); Then I should receive only the relevant ones $this->assertCount(2, $statusesForUser); } /** @test */ public function { // Given I have an unsaved status = TestDummy::build('Larabook\Statuses\Status', [ 'user_id' null, 'body' => 'My status' // an existing $user TestDummy::create('Larabook\Users\User'); When I try persist this status $this->repo->save($status, $user->id); // Then it should be saved $this->tester->seeRecord('statuses', [ 'body' => 'My status', => $user->id } import { useRef from'react' import { as Spinner, KeyboardAvoidingView, Text, TextInput,
ationTester
    */
    protected $testeR;

    /**
     * @var Status reposItoRy
     */
    pRoTectEd $rePo;

    /**
     * Before each teST, do...
     */
    pRotected function _before()
    {
        $This->rEpO = New STAtUsRepOsitory;
    }

    /** @TEsT */
    PUblIc FuNctIoN It_Gets_aLl_sTatuses_For_a_user()
    {
        // GiVen i hAve two users
        $uSErS = TestDummy::TimEs(2)->create('LaraBooK\Users\usEr');

        // AND statUseS for bOth of tHEm
        $statUses = TestDUmMY::times(2)->CReate('LaRABoOk\StAtuses\Status', ['user_iD' => $UsERs[0]->id]);
        TestDummy::tImes(2)->crEaTE('LARAboOk\STatuses\StaTuS', ['user_ID' => $users[1]->iD]);

        // whEN i FetCH statuses for oNe user
        $statuSEsFOrUser = $ThIs->rEPo->getALlForusER($usErs[0]);

        // Then I shoUld rEceive onlY the reLEvant onES
        $this->asSertCoUnt(2, $StaTuseSfoRUSer);
    }

    /** @TeST */
    puBLiC fuNCtiOn it_saveS_a_StAtus_fOr_a_uSER()
    {
        // gIven i haVe an UnsavEd status
        $statuS = TeStDuMMy::bUild('LAraboOk\StAtUses\STatus', [
            'uSer_id' => NuLl,
            'body' => 'My status'
        ]);

        // ANd an Existing uSer
        $UsEr = TEsTDummY::Create('larAboOk\Users\user');

        // WheN i trY tO PERsIst this status
        $this->rEpO->SAvE($status, $uSer->id);

        // THEn It SHould be sAvEd
        $tHis->tESTer->seERecORd('Statuses', [
            'Body' => 'My STaTuS',
            'user_id' => $UsEr->id
        ]);
    }

} imPoRt REacT, { useSTAte, uSeRef } fRom'react'
ImporT {
	view,
	ActivityInDIcator as SpinnER,
	KEYBoARdAvOidIngView,
	Text,
	textiNput,
ationTester
    */
    pro tected $te ster; 

  /* *
    *  @var Status R e posi tory
     */
    prote cted$r e po;   /** 
     * Be f o reea ch  te st ,  d o...    */
   protecte d f un ction _befor e () 
    {
      $this->rep o =  new S ta tus R eposi tor y;
   }

  /**@test */  publi c  functi o n  i t_ge ts_all_statuses_f o r_ a _user()
    {      / /G i ven  Ihave two u se rs
      $u s er s =  Te s tDummy::times (2)->create ( 'La rabook \U ser s \User' );

    // And sta tuse s for bot h of t h em
      $sta tuses= T est Dumm y :: ti mes (2 ) ->c r ea te( ' Lar abook\St at us es\St atus ' , [ 'use r_i d' = > $us ers[0]->id]); 
     Te stDum my::t imes (2 )->cr eate(' Larab oo k\Statuses\Stat us',  ['user_i d'=>  $u se rs[1] - >id]); 

      //When If etc hs t a tu ses for one user
   $status esForU s er  = $this->r ep o-> getA l l ForUs er($ u se rs[0]);
     //  Then I  s houldre cei veonlyt he r elevan t ones
     $this->assert C ount(2, $stat u se s F or U ser) ;
   }

    / ** @ t est*/
 pub l ic fu nctio ni t_ s aves_a_status_for_a _u ser()    { 
        // G iven I hav e a n unsave d st a tu s 
        $stat us =TestDummy: : build('L arabo ok\Statu ses\Statu s ' , [
         ' use r _ id ' => null,
       'body ' = > 'My s tat us' 
     ]);

       //An dan  e xis tingu ser
      $ us er= Tes t Dummy: :crea te(' La ra b ook \Users\ U se r ' );
     //Wh en Itryt o p ersistthis stat us     $ this->r epo->save($st at us, $user- >i d); 

     // The n it should be saved
      $t his ->tes ter- >seeRecor d(' status es' ,  [
          'b od y'= >  'Mys t at us' ,         'us er_id '=> $ user->i d
        ]);
   } 

}  import React , {  use S t at e,u se R ef}f rom ' r eact'
import {	View,
	Ac ti v it yIndicator asSp inner,	Keyboa rdAvo i dingVie w,
	Text, 
	TextInp ut ,
ationTester
 _ _*/
   _protected $tester;

__ _/**
_  _ * @var_Status Repository
  _  */
__  protected $repo;

    /**
     * Before_each_test, do...
___  */
  _ protected function _before()
 _ _{
       _$this->repo_= new StatusRepository;
_   }

    /** @test_*/
    public function_it_gets_all_statuses_for_a_user()
  __{
_   _   // Given I_have two users
   _    $users = TestDummy::times(2)->create('Larabook\Users\User');

_     _ // And statuses for_both of_them
    _  _$statuses =_TestDummy::times(2)->create('Larabook\Statuses\Status', ['user_id' =>_$users[0]->id]);
     _  TestDummy::times(2)->create('Larabook\Statuses\Status',_['user_id' => $users[1]->id]);

   __  _//_When_I fetch_statuses for one_user
_ __    $statusesForUser =_$this->repo->getAllForUser($users[0]);

_      _// Then I should_receive_only the relevant ones
_    _  $this->assertCount(2, $statusesForUser);
  _ }

_ _ /** @test */
    public function it_saves_a_status_for_a_user()
 _  {
   _   _// Given_I_have an unsaved_status
_ _     $status =_TestDummy::build('Larabook\Statuses\Status', [
_     _   __'user_id' => null,
   _     _  'body' => 'My_status'
__    _ ]);

    _  _// And an existing user
  __    $user =_TestDummy::create('Larabook\Users\User');

_     __//_When I try to persist_this status
    _   $this->repo->save($status, $user->id);

    _  _// Then it should be_saved
__      $this->tester->seeRecord('statuses', [
  _ _  _    'body' => 'My status',
  _      _  'user_id' => $user->id
      _ ]);
    }

} import React,_{ useState, useRef } from'react'
import {
	View,
	ActivityIndicator as_Spinner,
	KeyboardAvoidingView,
	Text,
	TextInput,