11<?php
2- /**
3- * Copyright 2019 Cloud Creativity Limited
2+ /*
3+ * Copyright 2021 Cloud Creativity Limited
44 *
5- * Licensed under the Apache License, Version 2.0 (the "License");
5+ * Licensed under the Apache License, Version 2.0 (the "License");
66 * you may not use this file except in compliance with the License.
7- * You may obtain a copy of the License at
7+ * You may obtain a copy of the License at
88 *
9- * http://www.apache.org/licenses/LICENSE-2.0
9+ * http://www.apache.org/licenses/LICENSE-2.0
1010 *
11- * Unless required by applicable law or agreed to in writing, software
12- * distributed under the License is distributed on an "AS IS" BASIS,
13- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14- * See the License for the specific language governing permissions and
15- * limitations under the License.
11+ * Unless required by applicable law or agreed to in writing, software
12+ * distributed under the License is distributed on an "AS IS" BASIS,
13+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+ * See the License for the specific language governing permissions and
15+ * limitations under the License.
1616 */
1717
1818namespace CloudCreativity \JsonApi \Testing \Concerns ;
@@ -309,13 +309,13 @@ public function assertFetchedToManyInOrder($expected, bool $strict = true): self
309309 /**
310310 * Assert that a resource was created with a server generated id.
311311 *
312- * @param string $expectedLocation
313- * the expected location without the id.
312+ * @param string|null $expectedLocation
313+ * the expected location without the id, or null if no location header is expected .
314314 * @param UrlRoutable|string|int|array $expected
315315 * @param bool $strict
316316 * @return $this
317317 */
318- public function assertCreatedWithServerId (string $ expectedLocation , $ expected , bool $ strict = true ): self
318+ public function assertCreatedWithServerId (? string $ expectedLocation , $ expected , bool $ strict = true ): self
319319 {
320320 $ this ->document = HttpAssert::assertCreatedWithServerId (
321321 $ this ->getStatusCode (),
@@ -333,12 +333,13 @@ public function assertCreatedWithServerId(string $expectedLocation, $expected, b
333333 /**
334334 * Assert that a resource was created with a client generated id.
335335 *
336- * @param string $expectedLocation
336+ * @param string|null $expectedLocation
337+ * the expected location without the id, or null if no location header is expected.
337338 * @param UrlRoutable|string|int|array $expected
338339 * @param bool $strict
339340 * @return $this
340341 */
341- public function assertCreatedWithClientId (string $ expectedLocation , $ expected , bool $ strict = true ): self
342+ public function assertCreatedWithClientId (? string $ expectedLocation , $ expected , bool $ strict = true ): self
342343 {
343344 $ this ->document = HttpAssert::assertCreatedWithClientId (
344345 $ this ->getStatusCode (),
@@ -385,6 +386,7 @@ public function assertCreatedNoContent(string $expectedLocation): self
385386 * array representation of the expected resource, or null for a no-content response
386387 * @param bool $strict
387388 * @return $this
389+ * @deprecated 4.0 use not recommended: use `assertNoContent()` or `assertFetchedOne()` instead.
388390 */
389391 public function assertUpdated (array $ expected = null , bool $ strict = true ): self
390392 {
@@ -411,6 +413,7 @@ public function assertUpdated(array $expected = null, bool $strict = true): self
411413 * the expected top-level meta, or null for no content response.
412414 * @param bool $strict
413415 * @return $this
416+ * @deprecated 4.0 use not recommended: use `assertNoContent() or `assertMetaWithoutData()` instead.
414417 */
415418 public function assertDeleted (array $ expected = null , bool $ strict = true ): self
416419 {
0 commit comments