Skip to content

Commit d23e016

Browse files
committed
Added initial project structure
1 parent 048a190 commit d23e016

File tree

7 files changed

+171
-0
lines changed

7 files changed

+171
-0
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/vendor
2+
/node_modules
3+
.idea
4+
.DS_Store
5+
Thumbs.db
6+
composer.lock
7+
package-lock.json
8+
yarn.lock
9+
.phpunit.result.cache
10+
.php-cs-fixer.cache
11+
.swp
12+
*.map

composer.json

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
{
2+
"name": "whitecube/laravel-string-typography",
3+
"description": "A set of simple Str & Stringable macros helping to implement typographic rules",
4+
"keywords": [
5+
"whitecube",
6+
"laravel",
7+
"typography",
8+
"nbsp",
9+
"non-breakable space",
10+
"punctuation",
11+
"blade"
12+
],
13+
"type": "library",
14+
"license": "MIT",
15+
"autoload": {
16+
"psr-4": {
17+
"Whitecube\\Strings\\": "src/"
18+
}
19+
},
20+
"autoload-dev": {
21+
"psr-4": {
22+
"Whitecube\\Strings\\Tests\\": "tests/"
23+
}
24+
},
25+
"authors": [
26+
{
27+
"name": "Toon Van den Bos",
28+
"email": "[email protected]"
29+
}
30+
],
31+
"require": {
32+
"php": "^8.0",
33+
"laravel/framework": "^9|^10|^11"
34+
},
35+
"require-dev": {
36+
"orchestra/testbench": "^9.2",
37+
"pestphp/pest": "^2.34"
38+
},
39+
"extra": {
40+
"laravel": {
41+
"providers": [
42+
"Whitecube\\Strings\\ServiceProvider"
43+
]
44+
}
45+
},
46+
"config": {
47+
"sort-packages": true,
48+
"allow-plugins": {
49+
"pestphp/pest-plugin": true
50+
}
51+
}
52+
}

phpunit.xml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.3/phpunit.xsd"
4+
bootstrap="vendor/autoload.php"
5+
colors="true"
6+
>
7+
<testsuites>
8+
<testsuite name="Test Suite">
9+
<directory suffix="Test.php">./tests</directory>
10+
</testsuite>
11+
</testsuites>
12+
<source>
13+
<include>
14+
<directory suffix=".php">./src</directory>
15+
</include>
16+
</source>
17+
</phpunit>

src/ServiceProvider.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
3+
namespace Whitecube\Strings;
4+
5+
use Illuminate\Support\ServiceProvider as Provider;
6+
7+
class ServiceProvider extends Provider
8+
{
9+
/**
10+
* Register the application services.
11+
*/
12+
public function register()
13+
{
14+
}
15+
16+
/**
17+
* Bootstrap the application services.
18+
*/
19+
public function boot()
20+
{
21+
}
22+
}

tests/Pest.php

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<?php
2+
3+
/*
4+
|--------------------------------------------------------------------------
5+
| Test Case
6+
|--------------------------------------------------------------------------
7+
|
8+
| The closure you provide to your test functions is always bound to a specific PHPUnit test
9+
| case class. By default, that class is "PHPUnit\Framework\TestCase". Of course, you may
10+
| need to change it using the "uses()" function to bind a different classes or traits.
11+
|
12+
*/
13+
14+
uses(\Whitecube\Strings\Tests\TestCase::class)->in('Unit');
15+
16+
/*
17+
|--------------------------------------------------------------------------
18+
| Expectations
19+
|--------------------------------------------------------------------------
20+
|
21+
| When you're writing tests, you often need to check that values meet certain conditions. The
22+
| "expect()" function gives you access to a set of "expectations" methods that you can use
23+
| to assert different things. Of course, you may extend the Expectation API at any time.
24+
|
25+
*/
26+
27+
// expect()->extend('toBeOne', function () {
28+
// return $this->toBe(1);
29+
// });
30+
31+
/*
32+
|--------------------------------------------------------------------------
33+
| Functions
34+
|--------------------------------------------------------------------------
35+
|
36+
| While Pest is very powerful out-of-the-box, you may have some testing code specific to your
37+
| project that you don't want to repeat in every file. Here you can also expose helpers as
38+
| global functions to help you to reduce the number of lines of code in your test files.
39+
|
40+
*/
41+
42+
// function something()
43+
// {
44+
// // ..
45+
// }

tests/TestCase.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
namespace Whitecube\Strings\Tests;
4+
5+
use Orchestra\Testbench\TestCase as Orchestra;
6+
use Whitecube\Strings\ServiceProvider;
7+
8+
abstract class TestCase extends Orchestra
9+
{
10+
protected function getPackageProviders($app)
11+
{
12+
return [
13+
ServiceProvider::class,
14+
];
15+
}
16+
}

tests/Unit/ExampleTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
use Whitecube\Strings\ServiceProvider;
4+
5+
it('can load ServiceProvider correctly', function() {
6+
expect(app()->providerIsLoaded(ServiceProvider::class))->toBeTrue();
7+
});

0 commit comments

Comments
 (0)