Example #1
0
 public function showLogsBySpecificDate($day, $month, $year)
 {
     $date = $day . "/" . $month . "/" . $year;
     $today = $this->getCurrentDate();
     $currentDate = $today['currentDay'] . "/" . $today['currentMonth'] . "/" . $today['currentYear'];
     if ($date == $currentDate) {
         return redirect('day');
     }
     $targetDateObject = Carbon::createFromFormat('d/m/Y', $date);
     $targetDateArray = $this->dateObjectToArray($targetDateObject);
     Carbon::setTestNow($targetDateObject);
     $dateObjectYesterday = $targetDateObject->yesterday();
     $dateObjectTomorrow = $targetDateObject->tomorrow();
     $dateArrayYesterday = $this->dateObjectToArray($dateObjectYesterday);
     $dateArrayTomorrow = $this->dateObjectToArray($dateObjectTomorrow);
     $dayBefore = $dateArrayYesterday['currentDay'] . "/" . $dateArrayYesterday['currentMonth'] . "/" . $dateArrayYesterday['currentYear'];
     $dayAfter = $dateArrayTomorrow['currentDay'] . "/" . $dateArrayTomorrow['currentMonth'] . "/" . $dateArrayTomorrow['currentYear'];
     //checks if a lists exists for a corresponnding date. If there is no list, returns a null value.
     $currentList = $this->listRepository->getSpecificList($date);
     if (!empty($currentList)) {
         $currentListID = $currentList->id;
         $logsData = $this->logRepository->getSpecificLogs($currentListID);
         if (empty($logsData)) {
             $logsData = null;
         }
     } else {
         $logsData = null;
     }
     $data = ['thisDay' => "class = active ", 'thisWeek' => '', 'thisMonth' => '', 'id' => 'thisDay'];
     $dayName = $targetDateArray['currentDayName'];
     $monthName = $targetDateArray['currentMonthName'];
     $day = $targetDateArray['currentDay'];
     $year = $targetDateArray['currentYear'];
     return view('main-tabs.thisDay', $data)->with('logsData', $logsData)->with('dayBefore', $dayBefore)->with('dayAfter', $dayAfter)->with('dayName', $dayName)->with('monthName', $monthName)->with('day', $day)->with('year', $year);
 }
Example #2
0
 public function specificDatesOfWeek($year, $month, $day)
 {
     $weekSpecified = Carbon::create($year, $month, $day, 0);
     //setting the date passed as the current date for subtraction and addition using carbon functions
     Carbon::setTestNow($weekSpecified);
     $targetDay = $this->dateObjectToArray($weekSpecified);
     //retrieving data for the next 3 days prior and after the currentDate
     $dateDayAfter = $weekSpecified->tomorrow();
     $dateDayBefore = $weekSpecified->yesterday();
     $dateDayAfter2 = $weekSpecified->tomorrow()->addDay();
     $dateDayAfter3 = $weekSpecified->tomorrow()->addDays(2);
     $dateDayBefore2 = $weekSpecified->yesterday()->subDay();
     $dateDayBefore3 = $weekSpecified->yesterday()->subDays(2);
     $weekBeforeObject = $weekSpecified->yesterday()->subDays(6);
     $weekAfterObject = $weekSpecified->tomorrow()->addDays(6);
     //unsetting the date
     Carbon::setTestNow();
     //putting the data in the array using the function using the ObjectToArray Trait
     $dayAfter = $this->dateObjectToArray($dateDayAfter);
     $dayBefore = $this->dateObjectToArray($dateDayBefore);
     $dayAfter2 = $this->dateObjectToArray($dateDayAfter2);
     $dayAfter3 = $this->dateObjectToArray($dateDayAfter3);
     $dayBefore2 = $this->dateObjectToArray($dateDayBefore2);
     $dayBefore3 = $this->dateObjectToArray($dateDayBefore3);
     $weekBefore = $this->dateObjectToArray($weekBeforeObject);
     $weekAfter = $this->dateObjectToArray($weekAfterObject);
     $data = ['thisDay' => '', 'thisWeek' => "class = active ", 'thisMonth' => '', 'id' => 'thisWeek'];
     // $listdata = $this->listRepository->getLists();
     return view('main-tabs.thisWeek', $data)->with('targetDay', $targetDay)->with('dayBefore', $dayBefore)->with('dayAfter', $dayAfter)->with('dayAfter2', $dayAfter2)->with('dayAfter3', $dayAfter3)->with('dayBefore2', $dayBefore2)->with('dayBefore3', $dayBefore3)->with('weekYearBefore', $weekBefore['currentYear'])->with('weekYearAfter', $weekAfter['currentYear'])->with('weekMonthBefore', $weekBefore['currentMonth'])->with('weekMonthAfter', $weekAfter['currentMonth'])->with('weekDayBefore', $weekBefore['currentDay'])->with('weekDayAfter', $weekAfter['currentDay']);
 }
 public function setUp()
 {
     Carbon::setTestNow(Carbon::createFromTimeStampUTC(123));
     $this->claimFactory = Mockery::mock('Tymon\\JWTAuth\\Claims\\Factory');
     $this->validator = Mockery::mock('Tymon\\JWTAuth\\Validators\\PayloadValidator');
     $this->factory = new PayloadFactory($this->claimFactory, Request::create('/foo', 'GET'), $this->validator);
 }
 public function testSendMessage()
 {
     // Create an old email to purge
     Config::set('mail-tracker.expire-days', 1);
     $old_email = \jdavidbakr\MailTracker\Model\SentEmail::create(['hash' => str_random(32)]);
     $old_url = \jdavidbakr\MailTracker\Model\SentEmailUrlClicked::create(['sent_email_id' => $old_email->id, 'hash' => str_random(32)]);
     // Go into the future to make sure that the old email gets removed
     \Carbon\Carbon::setTestNow(\Carbon\Carbon::now()->addWeek());
     $faker = Faker\Factory::create();
     $email = $faker->email;
     $subject = $faker->sentence;
     $name = $faker->firstName . ' ' . $faker->lastName;
     \View::addLocation(__DIR__);
     \Mail::send('email.test', [], function ($message) use($email, $subject, $name) {
         $message->from('*****@*****.**', 'From Name');
         $message->sender('*****@*****.**', 'Sender Name');
         $message->to($email, $name);
         $message->cc('*****@*****.**', 'CC Name');
         $message->bcc('*****@*****.**', 'BCC Name');
         $message->replyTo('*****@*****.**', 'Reply-To Name');
         $message->subject($subject);
         $message->priority(3);
     });
     $this->seeInDatabase('sent_emails', ['recipient' => $name . ' <' . $email . '>', 'subject' => $subject, 'sender' => 'From Name <*****@*****.**>', 'recipient' => "{$name} <{$email}>"]);
     $this->assertNull($old_email->fresh());
     $this->assertNull($old_url->fresh());
 }
Example #5
0
 public function testParseRelativeWithTestValueSet()
 {
     $notNow = Carbon::parse('2013-09-01 05:15:05');
     Carbon::setTestNow($notNow);
     $this->assertEquals('2013-09-01 05:10:05', Carbon::parse('5 minutes ago')->toDateTimeString());
     $this->assertEquals('2013-08-25 05:15:05', Carbon::parse('1 week ago')->toDateTimeString());
     $this->assertEquals('2013-09-02 00:00:00', Carbon::parse('tomorrow')->toDateTimeString());
     $this->assertEquals('2013-08-31 00:00:00', Carbon::parse('yesterday')->toDateTimeString());
     $this->assertEquals('2013-09-02 05:15:05', Carbon::parse('+1 day')->toDateTimeString());
     $this->assertEquals('2013-08-31 05:15:05', Carbon::parse('-1 day')->toDateTimeString());
     $this->assertEquals('2013-09-02 00:00:00', Carbon::parse('next monday')->toDateTimeString());
     $this->assertEquals('2013-09-03 00:00:00', Carbon::parse('next tuesday')->toDateTimeString());
     $this->assertEquals('2013-09-04 00:00:00', Carbon::parse('next wednesday')->toDateTimeString());
     $this->assertEquals('2013-09-05 00:00:00', Carbon::parse('next thursday')->toDateTimeString());
     $this->assertEquals('2013-09-06 00:00:00', Carbon::parse('next friday')->toDateTimeString());
     $this->assertEquals('2013-09-07 00:00:00', Carbon::parse('next saturday')->toDateTimeString());
     $this->assertEquals('2013-09-08 00:00:00', Carbon::parse('next sunday')->toDateTimeString());
     $this->assertEquals('2013-08-26 00:00:00', Carbon::parse('last monday')->toDateTimeString());
     $this->assertEquals('2013-08-27 00:00:00', Carbon::parse('last tuesday')->toDateTimeString());
     $this->assertEquals('2013-08-28 00:00:00', Carbon::parse('last wednesday')->toDateTimeString());
     $this->assertEquals('2013-08-29 00:00:00', Carbon::parse('last thursday')->toDateTimeString());
     $this->assertEquals('2013-08-30 00:00:00', Carbon::parse('last friday')->toDateTimeString());
     $this->assertEquals('2013-08-31 00:00:00', Carbon::parse('last saturday')->toDateTimeString());
     $this->assertEquals('2013-08-25 00:00:00', Carbon::parse('last sunday')->toDateTimeString());
     $this->assertEquals('2013-09-02 00:00:00', Carbon::parse('this monday')->toDateTimeString());
     $this->assertEquals('2013-09-03 00:00:00', Carbon::parse('this tuesday')->toDateTimeString());
     $this->assertEquals('2013-09-04 00:00:00', Carbon::parse('this wednesday')->toDateTimeString());
     $this->assertEquals('2013-09-05 00:00:00', Carbon::parse('this thursday')->toDateTimeString());
     $this->assertEquals('2013-09-06 00:00:00', Carbon::parse('this friday')->toDateTimeString());
     $this->assertEquals('2013-09-07 00:00:00', Carbon::parse('this saturday')->toDateTimeString());
     $this->assertEquals('2013-09-01 00:00:00', Carbon::parse('this sunday')->toDateTimeString());
     $this->assertEquals('2013-10-01 05:15:05', Carbon::parse('first day of next month')->toDateTimeString());
     $this->assertEquals('2013-09-30 05:15:05', Carbon::parse('last day of this month')->toDateTimeString());
 }
Example #6
0
 /** @test */
 public function should_be_invalid_when_expired()
 {
     Carbon::setTestNow(Carbon::create(2014, 10, 11, 10, 23, 34));
     $reminder = new Reminder($this->id, $this->email, $this->code);
     Carbon::setTestNow(Carbon::create(2014, 10, 11, 11, 25, 12));
     $this->assertFalse($reminder->isValid());
 }
Example #7
0
 /**
  * Creates a Lumen application.
  *
  * @return \Laravel\Lumen\Application
  */
 protected function createApplication()
 {
     putenv('APP_ENV=' . $this->getEnv());
     $app = (require $this->appPath);
     Carbon::setTestNow(Carbon::now());
     return $app;
 }
Example #8
0
 /**
  * Creates a Laravel application.
  *
  * @return \Illuminate\Foundation\Application
  */
 protected function createApplication()
 {
     putenv('APP_ENV=' . $this->getEnv());
     $app = (require $this->appPath);
     $app->bootstrapWith(['Illuminate\\Foundation\\Bootstrap\\DetectEnvironment', 'Illuminate\\Foundation\\Bootstrap\\LoadConfiguration', 'Illuminate\\Foundation\\Bootstrap\\ConfigureLogging', 'Illuminate\\Foundation\\Bootstrap\\HandleExceptions', 'Illuminate\\Foundation\\Bootstrap\\RegisterFacades', 'Illuminate\\Foundation\\Bootstrap\\SetRequestForConsole', 'Illuminate\\Foundation\\Bootstrap\\RegisterProviders', 'Illuminate\\Foundation\\Bootstrap\\BootProviders']);
     Carbon::setTestNow(Carbon::now());
     return $app;
 }
Example #9
0
 /** @test */
 public function should_find_reminder_and_return_false_when_invalid()
 {
     Carbon::setTestNow(Carbon::create(2014, 10, 11, 10, 23, 34));
     $reminder = new Reminder($this->fixture['id'], $this->fixture['email'], $this->fixture['code']);
     Carbon::setTestNow();
     $this->reminders->shouldReceive('findReminderByEmailAndCode')->andReturn($reminder);
     $this->assertFalse($this->service->check('*****@*****.**', 'abc123'));
 }
 public function testSetDefaultEndDate()
 {
     $knownDate = Carbon::createFromDate(2001, 5, 21);
     // create testing date
     Carbon::setTestNow($knownDate);
     $this->salary->setEndDate();
     $this->assertEquals('2001-12-31', $this->tester->getPrivateProperty($this->salary, 'endDate')->toDateString());
 }
Example #11
0
 public function setUp()
 {
     Carbon::setTestNow(Carbon::createFromTimeStampUTC(123));
     $claims = [new Subject(1), new Issuer('http://example.com'), new Expiration(123 + 3600), new NotBefore(123), new IssuedAt(123), new JwtId('foo')];
     $this->validator = Mockery::mock('Tymon\\JWTAuth\\Validators\\PayloadValidator');
     $this->validator->shouldReceive('setRefreshFlow->check');
     $this->payload = new Payload($claims, $this->validator);
 }
Example #12
0
 public function setUp()
 {
     Carbon::setTestNow(Carbon::createFromTimeStampUTC(123));
     $this->storage = Mockery::mock('Tymon\\JWTAuth\\Providers\\Storage\\StorageInterface');
     $this->blacklist = new Blacklist($this->storage);
     $this->blacklist->setRefreshTTL(20160);
     $this->validator = Mockery::mock('Tymon\\JWTAuth\\Validators\\PayloadValidator');
     $this->validator->shouldReceive('setRefreshFlow->check');
 }
Example #13
0
 public function testSaveWithGoodData()
 {
     // prevent tests breaking due to rolling into the next second
     Carbon::setTestNow($c = Carbon::now());
     $expected = ['id' => 12345, 'name' => 'Foo Baz', 'username' => 'baz', 'email' => '*****@*****.**', 'updated_at' => (string) $c, 'created_at' => (string) $c];
     $user = User::create(['id' => '12345', 'name' => 'Foo Baz', 'username' => 'baz', 'email' => '*****@*****.**', 'token' => str_repeat('a', 40)]);
     $this->assertInstanceOf(User::class, $user);
     $this->assertSame($expected, $user->toArray());
 }
Example #14
0
 public function testSaveWithGoodData()
 {
     // prevent tests breaking due to rolling into the next second
     Carbon::setTestNow($c = Carbon::now());
     $expected = ['id' => 12345, 'user_id' => 4242, 'name' => 'Foo/Baz', 'default_branch' => 'lol', 'updated_at' => (string) $c, 'created_at' => (string) $c];
     $repo = Repo::create(['id' => '12345', 'user_id' => '4242', 'name' => 'Foo/Baz', 'default_branch' => 'lol', 'token' => str_repeat('a', 20)]);
     $this->assertInstanceOf(Repo::class, $repo);
     $this->assertSame($expected, $repo->toArray());
 }
 /** @test */
 public function it_edits_a_album_review_with_an_album_cover()
 {
     $album = TestDummy::create('WITR\\AlbumReview', ['img_name' => '01234-review.jpg']);
     copy(__DIR__ . '/files/review.jpg', public_path() . '/img/albums/01234-review.jpg');
     $form = TestDummy::attributesFor('WITR\\AlbumReview', ['band_name' => 'test band_name', 'album_name' => 'test album', 'review' => 'test review', 'img_name' => __DIR__ . '/files/review.jpg']);
     Carbon::setTestNow(Carbon::create(2014, 5, 21, 12));
     $dbEntry = $form;
     $dbEntry['img_name'] = Carbon::now()->timestamp . '-review.jpg';
     $this->beEditor();
     $this->visit('/admin/reviews/' . $album->id)->onPage('/admin/reviews/' . $album->id)->submitForm('Update Review', $form)->andSee('Album Review Saved!')->onPage('/admin/reviews')->verifyInDatabase('album_reviews', $dbEntry)->cannotSeeFile(public_path() . '/img/albums/' . $album->img_name)->seeFile(public_path() . '/img/albums/' . $dbEntry['img_name']);
 }
Example #16
0
 public function setUp()
 {
     parent::setUp();
     // C locale means that no translations will be done.
     $this->app->setLocale('C');
     // Reset clock stuff. We pick a timezone at random and reset (and freeze)
     // Carbon::now() to current time.
     $timezones = array('Antarctica/South_Pole', 'Arctic/Longyearbyen', 'Australia/Tasmania', 'Pacific/Pohnpei');
     date_default_timezone_set($timezones[array_rand($timezones)]);
     Carbon::setTestNow(null);
     Carbon::setTestNow(Carbon::now());
     $this->setUp_doctrine();
 }
 /** @test */
 public function it_updates_an_event_with_picture()
 {
     Carbon::setTestNow(Carbon::create(2014, 5, 21, 12));
     $event = TestDummy::create('WITR\\Event', ['picture' => '01234-event.jpg']);
     copy(__DIR__ . '/files/event.jpg', public_path() . '/img/events/01234-event.jpg');
     $form = $event->toArray();
     $form['picture'] = __DIR__ . '/files/event.jpg';
     unset($form['id']);
     $dbEntry = $form;
     $dbEntry['picture'] = Carbon::now()->timestamp . '-event.jpg';
     $dbEntry['date'] = new Carbon($dbEntry['date']);
     $this->beAdmin();
     $this->visit('/admin/events/' . $event->id)->onPage('/admin/events/' . $event->id)->submitForm('Update Event', $form)->andSee('Event Saved!')->onPage('/admin/events')->verifyInDatabase('events', $dbEntry)->cannotSeeFile(public_path() . '/img/events/' . $event->picture)->seeFile(public_path() . '/img/events/' . $dbEntry['picture']);
 }
 public function testHas()
 {
     $key = $this->faker->userName;
     $value = $this->faker->randomNumber;
     $result = $this->store->set($key, $value);
     $this->assertTrue($this->store->has($key));
     $missingKey = $this->faker->md5;
     $this->assertFalse($this->store->has($missingKey));
     $now = Carbon::now();
     Carbon::setTestNow($now);
     $this->store->set($key, $value, 1);
     Carbon::setTestNow($now->addSeconds(10));
     $this->assertFalse($this->store->has($key));
 }
 /** @test */
 public function it_updates_an_dj_with_picture()
 {
     Carbon::setTestNow(Carbon::create(2014, 5, 21, 12));
     $dj = TestDummy::create('WITR\\DJ', ['picture' => '01234-dj.jpg']);
     copy(__DIR__ . '/files/dj.jpg', public_path() . '/img/djs/01234-dj.jpg');
     $form = $dj->toArray();
     $form['picture'] = __DIR__ . '/files/dj.jpg';
     unset($form['id']);
     unset($form['updated_at']);
     unset($form['created_at']);
     $dbEntry = $form;
     $dbEntry['picture'] = Carbon::now()->timestamp . '-dj.jpg';
     $this->beAdmin();
     $this->visit('/admin/djs/' . $dj->id)->onPage('/admin/djs/' . $dj->id)->submitForm('Update DJ', $form)->andSee('DJ Saved!')->onPage('/admin/djs')->verifyInDatabase('djs', $dbEntry)->cannotSeeFile(public_path() . '/img/djs/' . $dj->picture)->seeFile(public_path() . '/img/djs/' . $dbEntry['picture']);
 }
Example #20
0
 public function testPostMetricPointTimestampTimezone()
 {
     if (defined('HHVM_VERSION')) {
         $this->markTestSkipped('Timezones are broken on HHVM.');
     }
     $this->beUser();
     // prevent tests breaking due to rolling into the next second
     Carbon::setTestNow(Carbon::now());
     $timezone = 'America/Mexico_City';
     $metric = factory('CachetHQ\\Cachet\\Models\\Metric')->create();
     $datetime = Carbon::now()->timezone($timezone);
     $metricPoint = factory('CachetHQ\\Cachet\\Models\\MetricPoint')->make(['metric_id' => $metric->id]);
     $postData = $metricPoint->toArray();
     $postData['timestamp'] = $datetime->timestamp;
     $this->post("/api/v1/metrics/{$metric->id}/points", $postData, ['Time-Zone' => $timezone]);
     $this->seeJson(['value' => $metricPoint->value, 'created_at' => $datetime->toDateTimeString()]);
 }
 /** @test */
 public function it_updates_an_show_with_picture()
 {
     Carbon::setTestNow(Carbon::create(2014, 5, 21, 12));
     $show = TestDummy::create('WITR\\Show', ['slider_picture' => '012345-slider_picture.jpg', 'show_picture' => '012345-show_picture.jpg']);
     copy(__DIR__ . '/files/slider_picture.jpg', public_path() . '/img/slider/01234-slider_picture.jpg');
     copy(__DIR__ . '/files/show_picture.jpg', public_path() . '/img/shows/01234-show_picture.jpg');
     $form = $show->toArray();
     $form['slider_picture'] = __DIR__ . '/files/slider_picture.jpg';
     $form['show_picture'] = __DIR__ . '/files/show_picture.jpg';
     unset($form['id']);
     unset($form['active']);
     $dbEntry = $form;
     $dbEntry['slider_picture'] = Carbon::now()->timestamp . '-slider_picture.jpg';
     $dbEntry['show_picture'] = Carbon::now()->timestamp . '-show_picture.jpg';
     $this->beAdmin();
     $this->visit('/admin/shows/' . $show->id)->onPage('/admin/shows/' . $show->id)->submitForm('Update Show', $form)->andSee('Show Saved!')->onPage('/admin/shows')->verifyInDatabase('shows', $dbEntry)->cannotSeeFile(public_path() . '/img/slider/' . $show->slider_picture)->cannotSeeFile(public_path() . '/img/shows/' . $show->show_picture)->seeFile(public_path() . '/img/slider/' . $dbEntry['slider_picture'])->seeFile(public_path() . '/img/shows/' . $dbEntry['show_picture']);
 }
Example #22
0
 /**
  * Load the User fixtures
  *
  * @param ObjectManager $manager
  * @return void
  */
 public function load(ObjectManager $manager)
 {
     // Create valid Reminder
     $id = ReminderId::generate();
     $email = new Email('*****@*****.**');
     $code = ReminderCode::fromNative('code+99');
     $reminder = new Reminder($id, $email, $code);
     $manager->persist($reminder);
     // Create expired Reminder
     Carbon::setTestNow(Carbon::create(2014, 10, 11, 10, 23, 34));
     $id = ReminderId::generate();
     $email = new Email('*****@*****.**');
     $code = ReminderCode::fromNative('code+1');
     $reminder = new Reminder($id, $email, $code);
     Carbon::setTestNow();
     $manager->persist($reminder);
     $manager->flush();
 }
Example #23
0
 public function testDiffForHumansAbsoluteMonths()
 {
     Carbon::setTestNow(Carbon::create(2012, 1, 1));
     $d = Carbon::now()->subMonths(2);
     $this->assertSame('2 months', Carbon::now()->diffForHumans($d, true));
     $d = Carbon::now()->addMonths(2);
     $this->assertSame('2 months', Carbon::now()->diffForHumans($d, true));
     Carbon::setTestNow();
 }
Example #24
0
 public static function last($day, $timestamp = null)
 {
     $vars = self::datetime($timestamp, true);
     if ($timestamp != null) {
         Carbon::setTestNow(self::create($vars['year'], $vars["month"], $vars["day"], $vars["hour"], $vars["minute"], $vars["second"]));
     }
     //
     return new Carbon('last ' . $day);
 }
Example #25
0
 /**
  * @inherit
  */
 public function setUp()
 {
     parent::setUp();
     Carbon::setTestNow();
 }
 public function testTimeZoneWithTestValueSet()
 {
     $notNow = Carbon::parse('2013-07-01 12:00:00', 'America/New_York');
     Carbon::setTestNow($notNow);
     $this->assertEquals('2013-07-01T12:00:00-0400', Carbon::parse('now')->toISO8601String());
     $this->assertEquals('2013-07-01T11:00:00-0500', Carbon::parse('now', 'America/Mexico_City')->toISO8601String());
     $this->assertEquals('2013-07-01T09:00:00-0700', Carbon::parse('now', 'America/Vancouver')->toISO8601String());
 }
Example #27
0
 public function testSaveWithGoodData()
 {
     // prevent tests breaking due to rolling into the next second
     Carbon::setTestNow($c = Carbon::now());
     $expected = ['repo_id' => 12345, 'branch' => 'test', 'commit' => str_repeat('a', 40), 'message' => 'Test 123!', 'status' => 2, 'hidden' => false, 'updated_at' => (string) $c, 'created_at' => (string) $c, 'id' => 1];
     $analysis = Analysis::create(['repo_id' => 12345, 'branch' => 'test', 'commit' => str_repeat('a', 40), 'message' => 'Test 123!', 'status' => 2, 'hidden' => 0]);
     $this->assertInstanceOf(Analysis::class, $analysis);
     $this->assertSame($expected, $analysis->toArray());
 }
Example #28
0
 public function tearDown()
 {
     Carbon::setTestNow();
     Mockery::close();
 }
 public function setUp()
 {
     Carbon::setTestNow(Carbon::createFromTimeStampUTC(123));
     $this->jws = Mockery::mock('Namshi\\JOSE\\JWS');
     $this->provider = new NamshiAdapter('secret', 'HS256', $this->jws);
 }
Example #30
0
 public function getLastWeekData($year, $month, $day, $date_id)
 {
     //creating the date in carbon data for subtraction of days
     $weekSpecified = Carbon::create($year, $month, $day, 0);
     Carbon::setTestNow($weekSpecified);
     $lastWeekObject = $weekSpecified->yesterday()->subDays(6);
     $lastWeekArray = $this->dateobjectToArray($lastWeekObject);
     $lastWeekParameters = $lastWeekArray['currentDay'] . "/" . $lastWeekArray['currentMonth'] . "/" . $lastWeekArray['currentYear'];
     $lastWeekLogs = $this->logRepository->getSpecificLogs($date_id);
 }