目前我已经开始学习 Laravel 5.6 中的单元测试。默认情况下,我的 laravel 项目有一个“tests”目录,其中还有 2 个目录,即“Features”和“Unit”。每个目录都包含一个“ExampleTest.php”
./tests/Features/ExampleTest.php
./tests/Unit/ExampleTest.php
Run Code Online (Sandbox Code Playgroud)
每当我使用命令创建新的测试文件时
php artisan make:test BasicTest
Run Code Online (Sandbox Code Playgroud)
默认情况下,它总是在“Features”目录中创建测试文件,而我希望在“tests”目录下创建该文件。
是否有一个命令可以用来指定测试文件的创建路径。像这样的东西
php artisan make:test BasicTest --path="tests"
Run Code Online (Sandbox Code Playgroud)
我已经尝试过上面的路径命令,但它不是有效的命令。
我需要更改 phpunit.xml 文件中的一些代码吗?
我想使用纯 CSS 来设计上面的图像。
到目前为止,我只能在没有编辑图标的情况下进行设计。
以下是我迄今为止提出的 HTML 和 CSS:
<div>
<img src="static\assets\images\avatar.jpg" class="main-profile-img" />
</div>
<style>
.main-profile-img {
width: 140px;
height: 140px;
border-radius: 50%;
border-style: solid;
border-color: #FFFFFF;
box-shadow: 0 0 8px 3px #B8B8B8;
}
</style>
Run Code Online (Sandbox Code Playgroud)
我只需要右上角编辑图标的 HTML 和 CSS 代码。
我有以下JavaScript代码:
const ary = ["Kevin", "brandy", "Andrew"];
const nary = ary.sort();
console.log(nary);
Run Code Online (Sandbox Code Playgroud)
我期望上面代码的输出是["Andrew","brandy", "Kevin"]根据单词的字典顺序。
但是在控制台中,我得到了输出:
["Andrew","Kevin","brandy"]
Run Code Online (Sandbox Code Playgroud)
当我切换b在"brandy"为大写B,并再次运行代码,
const ary = ["Kevin", "Brandy", "Andrew"];
const nary = ary.sort();
console.log(nary);
Run Code Online (Sandbox Code Playgroud)
输出达到预期:
["Andrew","Brandy","Kevin"]
即根据单词的字典顺序。
这意味着排序优先级将给予首字母大写的单词,然后对首字母小写的单词进行排序。
我的问题是:
为什么在JavaScript中会发生这种情况?
如何["Kevin", "brandy", "Andrew"]使用sort()函数根据单词的字典顺序对字符串数组进行排序?
Input code:
const ary = ["Kevin", "brandy", "Andrew"];
const nary = ary.sort();
console.log(nary);
Console Output:
["Andrew","Kevin","brandy"]
I want the Output as:
["Andrew","brandy", "Kevin"]
Run Code Online (Sandbox Code Playgroud)