Bladeren bron

Update tests

Daniel Supernault 6 jaren geleden
bovenliggende
commit
0c654f5e43

+ 0 - 55
tests/Unit/ActivityPub/AcceptVerbTest.php

@@ -1,55 +0,0 @@
-<?php
-
-namespace Tests\Unit;
-
-use Tests\TestCase;
-use Illuminate\Foundation\Testing\WithFaker;
-use Illuminate\Foundation\Testing\RefreshDatabase;
-use App\Util\ActivityPub\Validator\Accept;
-
-class AcceptVerbTest extends TestCase
-{
-	protected $validAccept;
-	protected $invalidAccept;
-
-	public function setUp()
-	{
-		parent::setUp();
-		$this->validAccept = [
-			'@context' => 'https://www.w3.org/ns/activitystreams',
-			'id' => 'https://example.org/og/b3e4a40b-0b26-4c5a-9079-094bd633fab7',
-			'type' => 'Accept',
-			'actor' => 'https://example.org/u/alice',
-			'object' => [
-				'id' => 'https://example.net/u/bob#follows/bb27f601-ddb9-4567-8f16-023d90605ca9',
-				'type' => 'Follow',
-				'actor' => 'https://example.net/u/bob',
-				'object' => 'https://example.org/u/alice'
-			]
-		];
-		$this->invalidAccept = [
-			'@context' => 'https://www.w3.org/ns/activitystreams',
-			'id' => 'https://example.org/og/b3e4a40b-0b26-4c5a-9079-094bd633fab7',
-			'type' => 'Accept2',
-			'actor' => 'https://example.org/u/alice',
-			'object' => [
-				'id' => 'https://example.net/u/bob#follows/bb27f601-ddb9-4567-8f16-023d90605ca9',
-				'type' => 'Follow',
-				'actor' => 'https://example.net/u/bob',
-				'object' => 'https://example.org/u/alice'
-			]
-		];
-	}
-
-	/** @test */
-	public function basic_accept()
-	{
-		$this->assertTrue(Accept::validate($this->validAccept));
-	}
-
-	/** @test */
-	public function invalid_accept()
-	{
-		$this->assertFalse(Accept::validate($this->invalidAccept));
-	}
-}

+ 1 - 1
tests/Unit/ActivityPub/AudienceScopeTest.php

@@ -9,7 +9,7 @@ use App\Util\ActivityPub\Helpers;
 
 class AudienceScopeTest extends TestCase
 {
-	public function setUp()
+	public function setUp(): void
 	{
 		parent::setUp();
 

File diff suppressed because it is too large
+ 1 - 1
tests/Unit/ActivityPub/NoteAttachmentTest.php


+ 1 - 1
tests/Unit/ActivityPub/Verb/AnnounceTest.php

@@ -10,7 +10,7 @@ use App\Util\ActivityPub\Validator\Announce;
 class AnnounceTest extends TestCase
 {
 
-	public function setUp()
+	public function setUp(): void
 	{
 		parent::setUp();
 

+ 1 - 2
tests/Unit/Lexer/StatusLexerTest.php

@@ -14,7 +14,7 @@ class StatusLexerTest extends TestCase
     public $entities;
 	public $autolink;
 
-    public function setUp()
+    public function setUp(): void
     {
         parent::setUp();
     	$this->status = "@pixelfed hi, really like the website! #píxelfed";
@@ -60,7 +60,6 @@ class StatusLexerTest extends TestCase
     public function testAutolink()
     {
         $expected = '@<a class="u-url mention" href="https://pixelfed.dev/pixelfed" rel="external nofollow noopener" target="_blank">pixelfed</a> hi, really like the website! <a href="https://pixelfed.dev/discover/tags/píxelfed?src=hash" title="#píxelfed" class="u-url hashtag" rel="external nofollow noopener">#píxelfed</a>';
-
         $this->assertEquals($this->autolink, $expected);
     }
 }

Some files were not shown because too many files changed in this diff