Skip to content

Commit

Permalink
add PostTypeRegistrar tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jjgrainger committed Oct 24, 2024
1 parent 5294c65 commit 7107d13
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
24 changes: 24 additions & 0 deletions tests/Registrars/PostTypeRegistrarTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

use PHPUnit\Framework\TestCase;
use PostTypes\PostType;
use PostTypes\Registrars\PostTypeRegistrar;

class PostTypeRegistrarTest extends TestCase
{
/** @test */
public function canModifyPostType()
{
$posttype = new PostType('post', [
'public' => false,
]);

$registrar = new PostTypeRegistrar($posttype);

$options = $registrar->modifyPostType([
'public' => true,
], 'post');

$this->assertEquals(false, $options['public']);
}
}

0 comments on commit 7107d13

Please sign in to comment.